Ticket Q513903
Visible to All Users

checkedit group, making it possible to have no boxes checked

created 12 years ago

I am working with CheckEdit controls that have the same radiogroupindex, however I want to have the ability to let the user have ALL boxes in the same group unchecked. Is this possible with CheckEdit?

For example, I have a Yes and a No checkbox in the same group, but I want to be able to have both unchecked and have everything still work.

thanks

Answers approved by DevExpress Support

created 12 years ago (modified 12 years ago)

Hi,
To achieve your goal, handle the CheckEdit.CheckedChanged event in the following manner:

C#
void checkEdit1_CheckedChanged(object sender, EventArgs e) { if (Control.ModifierKeys == Keys.Control) { checkEdit1.Checked = false; checkEdit2.Checked = false; } }

This code allows you to set the Checked state to false if the Control key was pressed when clicking the CheckEdit.
I have created an example to demonstrate this. Please try it on your side and inform me of your results.

    Comments (3)

      This works, however, it allows both Yes and No to be checked at the same time, which is not what I want. I need it to have three states basically, yes checked, no checked, or neither checked.
      thanks

        Nevermind, it works like you said. However, is there anyway to do this without using the control key?

        Alisher (DevExpress Support) 12 years ago

          Hi Matthew,
          You can set the Checked state of the CheckEdit control via the right mouse button click. For this handle the CheckEdit.MouseUp event in the following manner:

          C#
          void checkEdit1_MouseUp(object sender, MouseEventArgs e) { if (e.Button == System.Windows.Forms.MouseButtons.Right) { checkEdit1.Checked = false; checkEdit2.Checked = false; } }

          I hope you find this information useful.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.