Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
735
display Boolean column checkbox without border?
posted

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 

 

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    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;           
            }

Children