Row index of datagrid from code render - how ?
ASP.NET
3
Posts
3
Posters
0
Views
1
Watching
-
Hi everybofy, I want to send the row index of a datagrid as an argument of a function from the html: Thanks
Hi there, Each row of the datagrid control is represented by the
DataGridItem
object. So if you want to get the item index, you first need to get reference to the item, then get the value of theItemIndex
property. The sample code looks something like:<asp:HyperLink NavigateUrl='<%# GetUrl(((DataGridItem)Container).ItemIndex) %>'>
The
GetUrl
method takes the item index (the integet type) as the method parameter. -
Hi everybofy, I want to send the row index of a datagrid as an argument of a function from the html: Thanks