1 回答

TA貢獻1820條經(jīng)驗 獲得超2個贊
這個 要明說是 模板加入的還是 單純的 復選框列
如果是復選框咧 直接遍歷列 轉(zhuǎn)換即可
如果是 模板列的話? 可以采用
?
foreach (var item in dgReportList.Items)
??????????? {
??????????????? DataGridTemplateColumn templeColumn = dgReportList.Columns[0] as DataGridTemplateColumn;
??????????????? FrameworkElement fwElement = dgReportList.Columns[0].GetCellContent(item) ;
??????????????? CheckBox cBox = templeColumn.CellTemplate.FindName("cBoxSelected", fwElement) as CheckBox
?;
??????????????? if (cBox != null)
??????????????? {
??????????????????? cBox.IsChecked = cBoxSelectedAll.IsChecked;
??????????????? }
??????????? }
- 1 回答
- 0 關(guān)注
- 601 瀏覽
添加回答
舉報