Ticket Q345015
Visible to All Users

How to toggle a checkbox editor with a single click when EditorShowModue = MouseUp

created 13 years ago

Hello,
In order to have the entire content of a cell selected when clicking in a grid, the gridView.OptionsBehavior property must be set to MouseUp, as it is described in A277 KB article - http://devexpress.com/Support/Center/KB/p/A277.aspx.
However, this creates some problems when having CheckEdit repositories because the user has to click twice to toggle the check edit (one click activates the editor and the second click toggles the repository's value).
To overcome this, I have successfully implemented the solution described in the following KB: http://www.devexpress.com/Support/Center/p/Q143431.aspx
But this KB only covers the case in which the CheckEdit repository is set via ColumnEdit property.
I have the following questions:

  1. How to achieve the same thing when a column is bound to a property of type Object and the repository is set at runtime via CustomRowCellEdit or CustomRowCellEditForEditing?
  2. How to implement this for a TreeList control?
    Thank you very much!
    Sorin.

Answers

created 13 years ago

Hi Sorin,

  1. In this instance you can check that an active editor is CheckEdit.
C#
private void gridView1_MouseDown(object sender, MouseEventArgs e) { if ((Control.ModifierKeys & Keys.Control) != Keys.Control) { GridView view = sender as GridView; GridHitInfo hi = view.CalcHitInfo(e.Location); if (hi.InRowCell) { view.FocusedRowHandle = hi.RowHandle; view.FocusedColumn = hi.Column; view.ShowEditor(); CheckEdit edit = (view.ActiveEditor as CheckEdit); if (edit != null) { edit.Toggle(); (e as DevExpress.Utils.DXMouseEventArgs).Handled = true; } } } }
  1. As this issue relates to another product I have created a new question.
    How to toggle a checkbox editor with a single click when EditorShowModue = MouseUp
    Please refer to this report for further correspondence on this item.
    If you need my further assistance please reactivate this ticket.
    Thanks,
    Gosha

    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.