Row Editing Retrieve Datakeys in GridView

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 4963
Row Editing Retrieve Datakeys in GridView
=======================================
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
string GrdUserName= GridView1.DataKeys[e.NewEditIndex].Values[0].ToString();
string GrdPassword = GridView1.DataKeys[e.NewEditIndex].Values[1].ToString();

GridView1.EditIndex = e.NewEditIndex;
LoadGrid();
}
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" ShowFooter="true" DataKeyNames ="username,password">
</asp:GridView>

Comments or Responses

Login to post response