This is for version 9.1 Windows Forms. I have the following structure in my UltraDataSource that contains 3 sibling children bands. Also, the first column in all bands contains a checkbox (including headers):
HEADER 0
Row 0 (Band 0)
Row 1 (Band 0)
Header 1
Row 0 (Band 1)
Row 1 (Band 1)
Header 2
Row 0 (Band 2)
Row 1 (Band 2)
Header 3
Row 0 (Band 3)
Row 1 (Band 3)
I have 2 questions
:
1) How do I have the checkbox show a square in it instead of a dull checkbox for CheckState Indeterminate?
2) How do I get the checkbox in Row 1 (Band 0) to show the correct CheckState based on the collective settings of Header 1, Header 2, and Header 3?
+ row2 (band 0)
ClaySeifert said:1) How do I have the checkbox show a square in it instead of a dull checkbox for CheckState Indeterminate?
I'm not sure what you mean by "a square" or "a dull checkbox". The CheckBox will appear differently based on the OS. But if you want to control the appearance of the CheckBox, you can use the GlyphInfo. For the grid, this means either setting the GlyphInfo on the UIElementDrawParams.CheckBoxGlyphInfo (which will affect all Infragistics controls in your application) or using an UltraCheckEditor for the grid column and using the GlyphInfo ont he UltraCheckEditor.
ClaySeifert said:2) How do I get the checkbox in Row 1 (Band 0) to show the correct CheckState based on the collective settings of Header 1, Header 2, and Header 3?
There's no automatic way to do this, you would have to code it yourself. I'd use the InitializeRow event, and/or the CellChange event of the grid to track changes in the checkboxes. If you use CellChange, be sure to check the Text property of the cell - you can't use Value, because Value will not be updated when the CellChange event fires.
Thank you Mike. Your answer to the second question is what I was looking for. As for the first question, let me clarify.
When I run the V9.1 Checkbox in Header example in the Sample Explorer application, all checkboxes either contain a checkmark for true, is empty for false, and a square within the checkbox area for indeterminent. That is in both the header and detail rows.
When I implemented the same capability in my application running on the same machine (I'm developing with VS2008 SP1), a checkmark was for true, no checkmark was for false, and a checkbox with the background area of the box area grayed and checked was for indeterminent. What I'm looking for is the same visual representation in the header checkbox as demostrated in the Sampe Explorer, but I want to limit the detail checkboxes to only display true or false values ---- no indeterminent.
Hope you can help and that this clarifies what I'm looking for.
This sounds like the difference between themed and non-themed drawing. Something must be turning off themes on your grid in your application and themes are turned on in the sample.
There are a number of ways to turn off themes. There's a UseOsThemes property on the grid. They can also be turned off via AppStylist. Are you loading an isl file in your application?
No -- but I am using the Office 2003 - Green Theme
Hi Mike
Regarding the tricheckbox vs checkox, the column header rendering is based on what type of checkbox is selected for the column. Therefore, I'll need to add code to see the value of the checkbox and if it is indeterminent, for it to false. This will resolve my issue. However, it would be a plus to be able to have separate settings for the column header checkbox to be tristate while the details are dualstate.
Thanks for your help
No -- it was set to Default. By setting it to True I got the square in a square representation. Thanks. That takes care of that issue. Now how do I only show True/False settings in the detail cell? Can I handle that in the CellChange event as well?
So you are loading a Preset into the grid? That might be turning off themes. Check the UseOsThemes property on the grid and see if it's set to False.