Ticket Q573533
Visible to All Users
Duplicate

DataGrid Multiple Row Selection

created 11 years ago

Hi,

I created a view controller and enabled the muptiple select feature. However, I cannot select individual rows. If I select an individual row, it will select then deselect the row immediately.

It only works if I select the header to select all rows. But selecting individual rows will generate this strange behavior. Please have a look at my code below. Maybe I missed something or I'm doing it the wrong way.

C#
private void SomeGridViewController_ViewControlsCreated(object sender, EventArgs e) { GridListEditor gridListEditor = ((ListView)View).Editor as GridListEditor; if (gridListEditor != null) { gridListEditor.GridView.OptionsSelection.MultiSelect = true; gridListEditor.GridView.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect; gridListEditor.GridView.OptionsSelection.ShowCheckBoxSelectorInColumnHeader = DevExpress.Utils.DefaultBoolean.False; gridListEditor.GridView.OptionsSelection.ShowCheckBoxSelectorInGroupRow = DevExpress.Utils.DefaultBoolean.False; gridListEditor.GridView.OptionsSelection.ShowCheckBoxSelectorInPrintExport = DevExpress.Utils.DefaultBoolean.False; } }

Answers approved by DevExpress Support

created 11 years ago (modified 11 years ago)

Hi Jason.
To make the check box selection column work correctly in the XAF GridListEditor, you need to additionally set the GridView.OptionsBehavior.EditorShowMode property to DevExpress.Utils.EditorShowMode.MouseUp. Refer to the Pattern advice needed - How to avoid code duplication when separate Web and WinUi Controllers are needed? ticket.

    Comments (2)

      Works like a charm. Thanks Michael.

      DevExpress Support Team 11 years ago

        You are welcome.

        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.