The following DataGrid has 2 BoundColumns with Visible set to false.
If I was using a ButtonColumn instead of a HyperLinkColumn, I could access
these variables in a custom event that would be fired by the ButtonColumn
Click.
Shouldn't you be able to bind more than one item to the querystring of a
HyperLinkColumn. Instead of using DataNavigateUrlFormatString="form.aspx?
action=Edit&ID={0}"
wouldn't it be nice if it automatically bound all BoundColumn's to the
query string.
<!-- code that i wish would work -->
<asp:BoundColumn DataField="ID" Visible="false" />
<asp:BoundColumn DataField="Title" Visible="false" />
<asp:HyperLinkColumn
NavigateUrl="form.aspx"
DataTextField="Title" />
wouldn't it be nice if this resulted in
<a href="form.aspx?ID=value&Title=value"> or better yet it would actually
POST to the url form.aspx sending ID & Title. of course you would need to
be able to add additional hidden parameters that were not part of the
DataGrid like action=Edit etc...
<!-- code below works --->
<asp:DataGrid
id="list"
runat="server"
AutoGenerateColumns="false"
ShowHeader="false">
<Columns>
<asp:BoundColumn DataField="ID" Visible="false" />
<asp:BoundColumn DataField="Title" Visible="false" />
<asp:HyperLinkColumn
DataNavigateUrlField="ID"
DataNavigateUrlFormatString="form.aspx?action=Edit&ID={0}"
DataTextField="Title" />
</Columns>
</asp:DataGrid>