Hello,
I'm using an UltraGrid containing a column with a boolean value. I want to change the style of the checkbox displayed in this column. I defined this style in an isl file designed using AppStylist application.
This works fine except if I want to change the checkBoxGlyphInfo property of the checkbox. Then nothing is changed in my grid. I tried to place a checkbox outside of my grid and then the style I defined with the checkBoxGlyphInfo property is applied to this checkbox.
Am I doing something wrong?
Hi,
You lost me. Are you talking about setting the CheckBoxGlyphInfo property in code or in the isl file?
Are you saying that the grid is displaying the checkboxes as you want them but you want to use a different style for UltraCheckEditor controls outside of the grid?
If you want to change the checkbox glyphs for your whole application, then you can do this in the Isl file and you do not have to set any properties in code.
Sorry if I am not clear enough. I already changed the checkbox glyphs in the isl file. The style of the checkbox outside of the grid if changed according to the glyph defined in the isl file, but this doesn't work for the checkbox that is contained in the grid.
I have attached a simple prototype to this message.
Okay, so the isl file you have here is applying the glyphs to the UltraCheckEditor component role. So that will only affect that one control and no others.
If you want to change the glyphs in the entire application, you should use the "All Components" role instead.
You could also be more selective, by going to the UltraGrid component role and changing the CheckBoxGlyphInfo there.
A third option would be to assign the UltraCheckEditor control to the grid column:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { this.ultraCheckEditor1.Text = string.Empty; this.ultraCheckEditor1.CheckAlign = ContentAlignment.MiddleCenter; e.Layout.Bands[0].Columns[0].EditorComponent = this.ultraCheckEditor1; }
Thanks. I changed the CheckBoxGlyphInfo for the UltraGrid and it works fine.
I have another question related to this topic. To display a checkbox in the header of the UltraGrid, I use a CreationFilter as explained here: http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=4883. I don't understand how I can define the style for the CheckBoxUIElement displayed in the header. Is it possible to define the CheckBoxGlyphInfo for this element?
I am submitting this as a development issue. You will receive more information through the support case.
Thanks Chris. It works.
Thank you for the sample. For some reason, toggling the HeaderCheckBoxVisibility worked in my sample but not in yours. I apologize for that. Instead, toggle the HeaderCheckBoxSynchronization property between None and Default. This definitely will trigger the synchronization process, and it makes more sense to use that property anyways. I verified this workaround in the sample you provided, and it updated the HeaderCheckBox state successfully.
Let me know if I can be of further assistance.
Chris.
Are you sure this workaround (using HeaderCheckBoxVisibility) works? I tried it in my application and in a prototype and the header checkbox is not upated.
I attached the prototype to this message.
It doesn't look like there is a workaround for the HeaderCheckBox - Glyph issue at this time.
In regards to your final issue, I took a brief look at the involved code. It appears the synchronization is not triggered when you refresh the Rows. This should also be put into developer review.
As a workaround, toggling the visible state of the checkboxes (using HeaderCheckBoxVisibility) should dirty the cached values, triggering the synchronization process. If you wrap this between SuspendLayout()/ResumeLayout() calls, you can minimize any flickering of the checkbox.
Hopefully this helps.
Chris