简体   繁体   中英

how to get gridview selected column

Work on asp.net C# vs05.window platform i can save value on Tag property.How can i use this property on web?By using the tag property ,i can easily get the selected row.code snipt

class name object = (className)listviewName.SelectedItems[0].Tag;

i want to get my gridview selected row value in a object like the above .How to get it?

     // Get the selected row from the GridView control.//

        GridViewRow selectRow = AuthorsGridView.SelectedRow

      //If the first column is, for example, LastName ...//

        String lastName = selectRow.Cells[1].Text;

GridViewRow on MSDN

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