简体   繁体   English

如何获取gridview选择的列

[英]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 在asp.net C#vs05.window平台上工作,我可以保存Tag属性的值。如何在Web上使用此属性?通过使用tag属性,我可以轻松获取所选的row.code片段

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? 我想让我的gridview在上面的对象中选择行值。如何获取它?

     // 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 MSDN上的GridViewRow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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