【问题标题】:How can i get the row selected in the DataGrid or GridView?如何获取在 DataGrid 或 GridView 中选择的行?
【发布时间】:2011-05-29 21:54:30
【问题描述】:

我可以在 ASP.NET 的 GridView 或 DataGrid 中选择行吗?请帮助解决这个问题。

【问题讨论】:

    标签: c# asp.net gridview datagrid


    【解决方案1】:
    protected void GridView1_SelectedIndexChanging (object sender, GridViewSelectEventArgs e)
    {
        GridViewRow row = GridView1.Rows[e.NewSelectedIndex];
    }
    

    【讨论】:

    • 我没有得到这个 GridViewSelectEventArgs 。
    • @programmer4programming:什么?
    • @programmer4programming:你是在利用 selectedindexchange 还是 selectedindexchanged 事件?更改的事件不使用 GridVIewSelectEventArgs...
    猜你喜欢
    • 2015-08-15
    • 1970-01-01
    • 2021-09-02
    • 2016-08-18
    • 1970-01-01
    • 1970-01-01
    • 2011-03-27
    • 2011-10-07
    • 2021-05-31
    相关资源
    最近更新 更多