Ticket T323472
Visible to All Users

How to prevent multi row selection when the CheckBoxRowSelect option is used

created 9 years ago

[DevExpress Support Team: CLONED FROM Q570580: CheckBoxRowSelect - Selection is cleared when you click outside of a check box column]
My Issue is not related to code mentioned above. I am trying to bind simple datatable with two data columns. Once the datasource is set and binded to grid. I am trying to set below two properties
gridViewAdresses.OptionsSelection.MultiSelect = true;
this.gridViewAdresses.OptionsSelection.MultiSelectMode =DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
Here I am able to see the checkbox as first column along with other two datacolumns of  datasource. But my concern at any point of time  I am able to check only one datarow checkbox. By selecting the  control I can can select multi rows checkboxes. But I do not want to have that way. I should be able to persist the previous checked checkbox state when I select other row checkbox.

Answers approved by DevExpress Support

created 9 years ago

Hello,

To accomplish this task, you can handle the GridView.SelectionChanged event and reset the selection from the previous row. I have created a project to illustrate this approach.
Please try the attached project and let us know if it works for you.
I am looking forward to your response.

    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.