R
rob merritt
I have a datagrid , that I populate using a template column with a
href around the data so when you click it it does a postback with the
index of the datagrid
index to operate on ie:
sub dgrid_update(s as object, e as
datagridcommandeventargs)
Session("username") = dgrid.datakeys(e.item.itemindex)
end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sub dgrid_select(s as object, e as
datagridcommandeventargs)
Session("username") = dgrid.datakeys(e.item.itemindex)
end sub
so what I need to know is how do I get the row index of each row so I
can
change
a href="javascript:__doPostBack('dgrid$_ctl2$_ctl0','')">
to
a href="javascript:__doPostBack('dgrid$_ctl<%#
something%>$_ctl0','')">
or is there a better way to do this ?
<Columns>
<asp:TemplateColumn HeaderText="Found">
<ItemTemplate>
<table border="0">
<tr>
<td><a href="javascript:__doPostBack('dgrid$_ctl2$_ctl0','')"><%#
DataBinder.Eval(Container.DataItem, "lname") %> <%#
DataBinder.Eval(Container.DataItem, "fname")%> </a></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
</Columns>
href around the data so when you click it it does a postback with the
index of the datagrid
index to operate on ie:
sub dgrid_update(s as object, e as
datagridcommandeventargs)
Session("username") = dgrid.datakeys(e.item.itemindex)
end sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
sub dgrid_select(s as object, e as
datagridcommandeventargs)
Session("username") = dgrid.datakeys(e.item.itemindex)
end sub
so what I need to know is how do I get the row index of each row so I
can
change
a href="javascript:__doPostBack('dgrid$_ctl2$_ctl0','')">
to
a href="javascript:__doPostBack('dgrid$_ctl<%#
something%>$_ctl0','')">
or is there a better way to do this ?
<Columns>
<asp:TemplateColumn HeaderText="Found">
<ItemTemplate>
<table border="0">
<tr>
<td><a href="javascript:__doPostBack('dgrid$_ctl2$_ctl0','')"><%#
DataBinder.Eval(Container.DataItem, "lname") %> <%#
DataBinder.Eval(Container.DataItem, "fname")%> </a></td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid>
</Columns>