c# - Getting GridView DataKeyNames values when Row_Editing event fires? -
the datakeynames
property in gridviewemp composed of 3 fields: empid, jobnumber, courseid. retrieve value of jobnumber.
so on gridview.rowediting
, tried out following snippet , value of empid (the first value of datakeynames
). i'm not sure how retrieve jobnumber or courseid:
protected void editgridview(object sender, gridviewediteventargs e) { string empid = gridviewemp.datakeys[e.neweditindex].value.tostring(); }
i need other 2 values, not sure how.
thanks.
by using values instead of value this:
string courseid = gridviewemp.datakeys[e.neweditindex].values[2].tostring();
Comments
Post a Comment