Gridview resetting to first ID value in filter

nodrac

New Member
I have 5 pages on my gridview each displaying 5 itemsThe very first item has an ID of 16 that then ranges to 39.The issue im currently facing, is when I filter my gridview, i.e lets say I filter my data and the only result has an ID of 30, then this is getting an ID of the first result 16 when displayed.I believe this could be down to how im gaining the ID of the item.This is the code I use to gain the ID:\[code\]GridViewRow row = ((Button)sender).Parent.Parent as GridViewRow;object ID = GridView1.DataKeys[row.RowIndex].Value;rowID = Convert.ToInt32(ID);\[/code\]
 
Top