2011-04-27 2 views
1

Syncfusion Windows Forms Grid에 확인란이있는 열을 만들어야합니다. 확인란 만있는 열을 만들 수 있지만 옆에 텍스트를 추가 할 수 없습니다. 아무도 이것으로 나를 도울 수 있습니까? Syncfusion 포럼에서 자료를 찾을 수 없습니다.Syncfusion Windows Forms Grid - C#

답변

3

이것은 Syncfusion의 온라인 설명서 - "그리드 셀에 특수 컨트롤 추가하기"의 WinForms Grid 사용자 가이드의 4.1.4.1.1 섹션에서 발췌 한 코드 샘플입니다.

설명 속성은 확인란 옆에 나타나는 텍스트를 추가합니다.

[C#] 


// Specify display values for True/False/Indeterminate. 

gridControl1.TableStyle.CheckBoxOptions = new GridCheckBoxCellInfo("True", "False", "", false); 



// Set up a check box with no tristate. 

gridControl1[rowIndex,colIndex].CellValue = false; 

gridControl1[rowIndex,colIndex].Description = "Click Me"; 

gridControl1[rowIndex,colIndex].CellType = "CheckBox"; 

gridControl1[rowIndex,colIndex].TriState = false; 



// Set up a check box with tristate. 

gridControl1[rowIndex,colIndex + 1].CellValue = true; 

gridControl1[rowIndex,colIndex + 1].CellType = "CheckBox"; 

gridControl1[rowIndex,colIndex + 1].TriState = true; 

gridControl1[rowIndex,colIndex + 1].Description = "TriState"; 


[VB.NET] 

' Specify display values for True/False/Indeterminate. 

gridControl1.TableStyle.CheckBoxOptions = New GridCheckBoxCellInfo("True", "False", "", False) 



' Set up a check box with no tristate. 

gridControl1(rowIndex, colIndex).CellValue = False 

gridControl1(rowIndex, colIndex).Description = "Click Me" 

gridControl1(rowIndex, colIndex).CellType = "CheckBox" 

gridControl1(rowIndex, colIndex).TriState = False 



' Set up a check box with tristate. 

gridControl1(rowIndex, colIndex + 1).CellValue = True 

gridControl1(rowIndex, colIndex + 1).CellType = "CheckBox" 

gridControl1(rowIndex, colIndex + 1).TriState = True 

gridControl1(rowIndex, colIndex + 1).Description = "TriState"