Asp.Net Gridview Buttonfield Gets Row Data

I have a Gridview associated with the datatable I created. The data in the table is constantly changing.

I added a button field to the gridview. When I click, I want to send a specific column value in this row by reference or sent via a function.

How do you do this?

+5
source share
2 answers

I learned how to do it. You set the commandName property for what you want to call inside the properties.

Then, if you double-click the button after it is created in design mode, it should output the function to the code page by page. You can then access the line by doing the following.

protected void gvUsers_RowCommand ( , GridViewCommandEventArgs e) {

 int rowNum = int.Parse(e.CommandArgument.ToString());

}

.

+6

All Articles