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
849
Hide checkbox in cell
posted

Hello,

I am trying to build a grid similar to those you can find in parental control application, i.e. with hours as columns, week days as rows, each cell is a boolean indicating if the object is active at this hour on this day. I hope this makes sense.

The thing is I don't want to show checkboxes but plain cell with colours (e.g. green means activated, red means deactivated). I have tried to set up this using events (InitializeRow and CellChange), based on the Text property or even a DrawFilter. It works very well for the background colour, but I didn't find anything to hide the checkbox. I then tried to use a CreationFilter: it worked well to initialize my cell with the correct background color and without the checkbox, but then the CellChange event is not fired when I click on the cell (which is, I suppose, because there is no more checkbox in the cell).

My question is: is it possible to make what I am trying to do? If yes, how?

Thanks in advance,

Damien

EDIT: Here is a screenshot of Vista parental control to illustrate what I try to achieve: http://img.clubic.com/photo/00479310.jpg 

Parents
  • 469350
    Verified Answer
    Offline posted

     Hi Damien,

        Here's a much easier way:

        1) Place an UltraCheckEditor control on the form with your grid.

            a) Set the Style property to Custom.

            b) Set the Appearance.BackColor to Red.

            c) Set the CheckedAppearance.BackColor to Green.

            d) clear the Text property

        2) Now set the grid column's EditorContorl property to the UltraCheckEditor control. You can use the same control for as many columns as you need.

    That's it. When you click the cell in the grid it will turn red (unchecked) or green (checked).

Reply Children