Language/SDK,Component
[Devexpress/WinForm/C#] XtraGrid (GridView) Record 단위 Checkbox (CheckBoxRowSelect) 설정
소소한 늙은 개발자의 메모장
2021. 9. 3. 10:17
반응형
(追記) (追記ここまで)
void SetMultiSelectMode(GridView view, DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode multiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect) {
view.OptionsSelection.MultiSelectMode = multiSelectMode;
}
string GetSelectedRows(GridView view) {
//출처 : DevExpress - "Demo Center 19.2" / WinForms Demos / Data Grid and Editors / UI CUSTOMIZATION / Cell Selection
string ret = "";
int rowIndex = -1;
if(view.OptionsSelection.MultiSelectMode != GridMultiSelectMode.CellSelect) {
foreach(int i in gridView1.GetSelectedRows()) {
DataRow row = gridView1.GetDataRow(i);
if(ret != "") ret += "\r\n";
ret += string.Format("{2}: {0} (#{1})", row["CompanyName"], i, Properties.Resources.CompanyName);
}
}
else {
foreach(GridCell cell in view.GetSelectedCells()) {
if(rowIndex != cell.RowHandle) {
if(ret != "") ret += "\r\n";
ret += string.Format("{1}: #{0}", cell.RowHandle, Properties.Resources.Row);
}
ret += "\r\n " + view.GetRowCellDisplayText(cell.RowHandle, cell.Column);
rowIndex = cell.RowHandle;
}
}
return ret;
}
반응형
(追記) (追記ここまで)
'Language > SDK,Component' 카테고리의 다른 글
| [Devexpress/WinForm/C#] XtraGrid - GridView CustomRowCellEdit (0) | 2021年10月26日 |
|---|---|
| [Devexpress/C#] XtraGrid 현재 선택된 Grid 쉘 컨트롤 (0) | 2012年12月12日 |
| Microsoft Exchange Web Service Managed API SDK 1.2.1 (0) | 2012年06月25日 |
| DevExpress dotNet Free Component (0) | 2011年09月27日 |
'Language/SDK,Component'의 다른글
- 이전글[Devexpress/C#] XtraGrid 현재 선택된 Grid 쉘 컨트롤
- 현재글[Devexpress/WinForm/C#] XtraGrid (GridView) Record 단위 Checkbox (CheckBoxRowSelect) 설정
- 다음글[Devexpress/WinForm/C#] XtraGrid - GridView CustomRowCellEdit