J
J. Shane Kunkle
I have a datagrid that contains a bunch of boundcolumns:
<asp:datagrid id="DataGrid1" runat="server" autogeneratecolumns="False">
<columns>
<asp:boundcolumn datafield="Column1" sortexpression=" Column1" />
<asp:boundcolumn datafield="Column2" sortexpression=" Column2" />
<asp:boundcolumn datafield="Column3" sortexpression=" Column3" />
...
</columns>
</datagrid>
On the ItemDataBound event for the DataGrid I need to return the index of
the column with a specific key (key is the name of the column in the
database that the column is databound to - ie "Column1", "Column2", etc).
I thought this would be very easy to do - just iterate through the
DataGrid1.Columns collection - however I can't find any properties of the
DataGridColumn that corresponds to the name of the column that it's bound
to.
Any ideas? Am I looking in the wrong place - wrong approach?
Any help or advice is very appreciated - thanks in advance,
J. Shane Kunkle
(e-mail address removed)
<asp:datagrid id="DataGrid1" runat="server" autogeneratecolumns="False">
<columns>
<asp:boundcolumn datafield="Column1" sortexpression=" Column1" />
<asp:boundcolumn datafield="Column2" sortexpression=" Column2" />
<asp:boundcolumn datafield="Column3" sortexpression=" Column3" />
...
</columns>
</datagrid>
On the ItemDataBound event for the DataGrid I need to return the index of
the column with a specific key (key is the name of the column in the
database that the column is databound to - ie "Column1", "Column2", etc).
I thought this would be very easy to do - just iterate through the
DataGrid1.Columns collection - however I can't find any properties of the
DataGridColumn that corresponds to the name of the column that it's bound
to.
Any ideas? Am I looking in the wrong place - wrong approach?
Any help or advice is very appreciated - thanks in advance,
J. Shane Kunkle
(e-mail address removed)