Gridview use question

P

Paul

Hi all,
I'm attempting to build a private message system into a site i'm
developing. The page which houses the private message code consists of
a multiview. The multiview contains a view of inbox, compose, reply
and read - these are switched between depending on the users actions -
and the active event is used to populate them etc. Firstly, does this
seem a sensible way of doing this?
Secondly, to display the contents of the inbox i'm using a gridview
control. An example of the control I am using can be seen below:

<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox runat="Server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton Text='<%#Eval("from") %>' PostBackUrl ='<%# "~/
profile.aspx?user=" + Eval("from") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton Text='<%#Eval("title") %>' CommandArgument ='<%#
Eval("idmessage") %>' OnCommand ="title_OnCommand" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Is using link buttons in this way ok? The last item template uses the
id to pass to the read view, and populate the correct email. The only
thing that concerned me is that when a link is rolled over, rather
than seeing a nice url as in other mail packages, I see a long
postback URL. I guess this might be a question of aesthetics?

Lastly, I'd ideally like to have one column filled with checkboxes
which allow all selected messages to be deleted. I've attempted to
databind the field idmessage to the ID property of the checkbox, but
it doesn't like this. How would I go about adding this functionality?

Any help would be appreciated.
 
C

chris.withers

Hi all,

If the other questions cannot be answered the last one is important.
Is there any way to a checkbox in a template field with a ID from the
dataset being bound to the gridview? I've attempted <%#
Eval("columnName") %> but this didn't work as it said databinding was
not supported. I simply wish to let each row of the gridview have a
checkbox. When a delete buttong is selected, the checked boxes and
related column is deleted from the DB. To do this, I need the id.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top