这个看看
public bool GetItemBool( int Row,string ColumnID )
{
if ( Row > YourDataGrid.Items.Count ) return false;
DataGridItem dgItem = YourDataGrid.Items[Row]; // Try to find & deal with each control.
for(int i=0;i<dgItem.Cells.Count;i++)
{
for(int j=0;j<dgItem.Cells[i].Controls.Count;j++)
{
Control ctrl = dgItem.Cells[i].Controls[j];
if ( ctrl.ID == ColumnID && ctrl is CheckBox ) return (( CheckBox )ctrl).Checked;
}
}
return false;
}

解决方案 »

  1.   

    偶是这样做的,先让它来帮定,这个字段这占一单元,然后再用代码来使其绑定。
    dim ctrl as control
    for i to dg.items.count
     if (true) then
       for each ctrl in dg.items.controls
        ctrl= dg.items(i).findcontrol(ck)
        if ctrl.gettype="system.web.ui.checkbox" then
          ctype(ctrl,checkbox).checked= true
        end if
        next
      end if
    next
    但我想用模板列来绑也能实现,不过没时间来做,有空帮你试试,先解你燃眉之急吧
      

  2.   

    页面加载时(page_load)加上
    if(!ispostback)
    {}
    我以前也遇过。搞了我1天时间。