简体   繁体   中英

Modifying and Deleting Items in asp gridview

I am currently working with gridview of asp.net.

I am using a SELECT statement to fill the gridview. When I am editing and deleting using in the gridview, It doesn't work, and all the example of this needs to pre-defined the columns of the gridvew meaning that there will be no SELECT statement to fill the gridview.

Is there a way that I can edit and delete the items in the gridview even though I use SELECT statement to fill the gridview?

Here is one way to modify the contents of the gridview cells:

Dim gvRow As GridViewRow

For Each gvRow In GridView1.Rows
  gvRow.Cells(rownumber).Text = "this was modified"
  next gvRow

You can use GridView.DeleteRow to remove a row.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM