A
ad
I have set "Years,GradeID" as DataKeyNames of a GridView.I use the codes
below to get the Keys value of a GridView, it is ok.
But if I sort this GridView on Pageload like:
gv.Sort("Years", SortDirection.Descending);
The e.e.Keys["Years"] is not define in the RowUpdating event.
What's problem? How can I get the Keys value after sort?
protected void gvCheckSem_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
int iYears = int.Parse(e.Keys["Years"].ToString());
int iGrade = int.Parse(e.Keys["GradeID"].ToString());
below to get the Keys value of a GridView, it is ok.
But if I sort this GridView on Pageload like:
gv.Sort("Years", SortDirection.Descending);
The e.e.Keys["Years"] is not define in the RowUpdating event.
What's problem? How can I get the Keys value after sort?
protected void gvCheckSem_RowUpdating(object sender,
GridViewUpdateEventArgs e)
{
int iYears = int.Parse(e.Keys["Years"].ToString());
int iGrade = int.Parse(e.Keys["GradeID"].ToString());