Hi,
I need to display Boolean datagrid column cell as below.
if ( valid == true) - checkbox with checked
if(valid == false) - checkbox with uncheck and different back color
if(valid == null) - donot display any (no check box).
Thanks
Hi Jos,
I'm not sure I understand what you are asking. Is this related to the rest of this thread? Nothing in this thread is talking about being unable to change the state of the checkbox.
If that's happening, then either the column in the grid does not allow editing, or the field in the data source does not.
Hi Mike
I did what you suggest by seting EditorControl = ultraCheckEditor1 but I still not able to change the status of the checkbox (checked/unchecked) from the application. Is there any missing?
Jos
There are a number of ways you could do this.
You could use glyphs and specify no image (or an empty, transparent image) for indeterminate state.
You could use InitializeRow and change the Style of the cell to Image or CheckBox based on the value. Since a boolean value cannot be translated into an image, setting the style to Image would leave the cell blank.
You could do something similar using the Hidden property on the cell, hiding the cell completely when the value is null.
So there is no way I can do something like below without using Appearance?.
I want to hide CheckBox in a cell if Value == null.
I don't want to display Intermediate chechbox when value == null ,Instead I want show blank cell.
What part of this is giving you trouble? Simpy binding the grid to a data source with a boolean field will display checked, unchecked, or indeterminate for true, false, and null.
If you are asking how to change the appearance of the checkboxes, then you have to use images. The checkbox glyphs are drawn by windows and they do not allow you to change just one part or one color. So you would have to replace the entire glyph with an image.
How you do this depends on whether you you want to do this for the entire application or just for individual grid columns.
For individual columns, you could use an UltraCheckEditor and use the GlyphInfo property. Then you set the grid column's EditorControl (or EditorComponent) to the UltraCheckEditor control.
To affect your entire application, you would use the static UIElementDrawParams.CheckBoxGlyphInfo property.