访问列标题中的复选框控件

问题描述 投票:0回答:1

我在 VS2019 中创建了一个应用程序 aps.net c#

我有一个网格视图,它的列标题中有一个复选框。 一旦用户单击要显示的单独按钮,我想验证列标题中名为“chkALL”的复选框,以查看它是否被选中。我似乎无法获得正确的语法来执行此操作。 请问有什么建议吗?

我的 ASPX 代码在这里:

**You need to create function for use it when fire event change checked box,

So this void it write** 





 private void  ChkAll_CheckedChanged(object sender, EventArgs e)
    {
    
        for (int i = 0; i < tgvCorrelations.Rows.Count; i++)  
            {  
                CheckBox chk = 
                 (CheckBox)tgvCorrelations.Rows[i].Cells[0].FindControl("chkAll");  
                if (chk.Checked)  
                {
    
                }
                else
                {
                    //...
                }
            }
    }
c# asp.net gridview
1个回答
0
投票
© www.soinside.com 2019 - 2024. All rights reserved.