Hi,
We are using Infragistics grid with the columns having checkbox style and dataSource values of type boolean (true or false). Is there any way to remove or hide the checkbox border in the checkbox columns so that cells will either show a checkmark or empty cell based on whether the boolean value is true or false respectively?
Thanks,
Zongwen Feng
The state of the checkbox comes from the grid cell, not the UltraCheckEditor. That would not make sense, since the one UltraCheckEditor is serving the entire column.
So you have to set the Value of the grid cell to false.
Hi mike,
Please see the below codes.
When I run this code checked UltraCheckEditor appear in the UltraWinGrid view cell.
I wont to make a unchecked UltraCheckEditor. Please help
private void grdUserDetails_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
//Create UltraCheckEditor
Infragistics.Win.UltraWinEditors.UltraCheckEditor chkBox = new Infragistics.Win.UltraWinEditors.UltraCheckEditor();
chkBox.Checked =false;
chkBox.GlyphInfo =UIElementDrawParams.StandardCheckBoxGlyphInfo;
chkBox.CheckAlign =ContentAlignment.MiddleCenter;
grdUserDetails.DisplayLayout.Bands[0].Columns[3].EditorControl = chkBox;
}
that solved our issue. thanks.
I just wanted to know if you were able to solve your issue based on Mike's suggestions or you still need help? Please let me know.
Thank you.
You cannot remove just the border because the check box is drawn by windows and it's pretty much all or nothing.
But there are a couple of ways you could achieve what you want. The easiest thing to do would be to create an image of a check mark (without a border) and then use a UltraCheckEditor in Custom style.
You can set up your UltraCheckEditor at design-time if you like. Just put one on the form, set it's Style to Custom and set the CheckedAppearance.Image to an image of your choice (a check mark without a border, for example).
Then set the grid column's EditorComponent property to the UltraCheckEditor control.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridBand band = layout.Bands[0]; UltraCheckEditor ultraCheckEditor = new UltraCheckEditor(); this.Controls.Add(ultraCheckEditor); ultraCheckEditor.Style = EditCheckStyle.Custom; ultraCheckEditor.CheckedAppearance.Image = DummyDataCreator.GetTextBitmap("V"); ultraCheckEditor.CheckedAppearance.ImageHAlign = HAlign.Center; ultraCheckEditor.CheckedAppearance.ImageVAlign = VAlign.Middle; band.Columns["Boolean 1"].EditorComponent = ultraCheckEditor; }