Query |
Solution |
We've seen on some samples that the indeterminate/tristate state is shown as box with a filled square in it, but we haven't been able to set this appearance. |
Solution1
In order to use tristate appearance for CheckBox, you can use the TriState property in QueryCellInfo event. Please refer to the below code example and the attached sample,
Code example
this.gridControl1.QueryCellInfo += gridControl1_QueryCellInfo;
void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
if (e.Style.CellIdentity.ColIndex == 5 && e.Style.CellIdentity.RowIndex > 0)
{
e.Style.CellType = GridCellTypeName.CheckBox;
e.Style.TriState = true;
//Used to set the checked, unchecked and intermediate value for checkbox value
e.Style.CheckBoxOptions = new GridCheckBoxCellInfo("1", "0", "", true);
}
}
|
Solution2
Also, you can achieve your scenario by using the below code example,
Code example
this.gridControl1[2, 5].CellType = GridCellTypeName.CheckBox;
this.gridControl1[2, 5].TriState = true;
this.gridControl1[2, 5]. CheckBoxOptions = new GridCheckBoxCellInfo("1", "0", "", true);
|
What we'd like to know is what needs to be set or configured to show the square in the box instead like in the image you posted.
Kind regards... Boris
Me.gridControl1.BaseStylesMap.Header.StyleInfo.Themed = False;
(or)
Me.gridControl1.BaseStylesMap.Item("Header").StyleInfo.Themed = False; |
Me.gridControl1.BaseStylesMap.RowHeader.StyleInfo.Themed = False;
(or)
Me.gridControl1.BaseStylesMap.Item("Row Header").StyleInfo.Themed = False; |
Me.gridControl1.BaseStylesMap.ColumnHeader.StyleInfo.Themed = False;
(or)
Me.gridControl1.BaseStylesMap.Item("Column Header").StyleInfo.Themed = False; |