i have a gridview control in which paging is enabled, i have a datakey value,i want to find a row index with respect to datakey value ,i have this code,
protected int GetRowIndex(object userID)
{
for(int i = 0l i <= GridView1.DataKey.Count -1 ; i++)
{
if(GridView1.DataKey[i].Value == userID)
{
return i;
}
}
}
but there is problem with this code, that if that user id is not found in that page it will return 0, my question is that how can i change the page index to find row in all pages.i am using gridview own paging.