阿宽

Nothing is more powerful than habit!
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Datagrid 中得到 HeaderTemplate 中的控件

Posted on 2009-06-30 18:34  宽田  阅读(332)  评论(0)    收藏  举报
得到Datagrid 中得到 HeaderTemplate 中的控件方法如下:
            Table tbVal = (Table)grdList.Controls[0];
            TableRow trVal 
= tbVal.Rows[0];
            Control ctlValSub 
= trVal.FindControl("ckbAll");
            
if (ctlValSub.GetType().ToString() == "System.Web.UI.WebControls.CheckBox")
            {
                CheckBox ckbVal 
= (CheckBox)ctlValSub;
            }