DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Use Datakey Names
Set following attribute of your grid view i.e. aspx
DataKeyNames="employeeId,departmentId"
Mostly following code in written when you have to iterate gridview on server side i.e. aspx.cs
string employeeId=gridView1.DataKeys[RowIndex].Values["employeeId"].ToString(); string departmentId=gridView1.DataKeys[RowIndex].Values["departmentId"].ToString();





