is there some way i can give the RowIndex as the data key in a gridview
-
What r u trying to do can you be more clear..!
LatestArticle :Log4Net Why Do Some People Forget To Mark as Answer .If It Helps.
i actually want to use to link buttons in one gridview .both the buttons perform different actions on click. earlier i had done this by using the protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) event for one button and for the other button i used protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { Session["sr_no"] = Convert.ToString(GridView1.DataKeys[e.RowIndex].Value); } here i had set a serial no from the data base as the data key and it worked fine but my current table does not have any serial no or a counter so am not able to set the datakey.
-
i actually want to use to link buttons in one gridview .both the buttons perform different actions on click. earlier i had done this by using the protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) event for one button and for the other button i used protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { Session["sr_no"] = Convert.ToString(GridView1.DataKeys[e.RowIndex].Value); } here i had set a serial no from the data base as the data key and it worked fine but my current table does not have any serial no or a counter so am not able to set the datakey.