We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridControl WPF, CellClick

Hi,

There is a strange behavior of the GridControl.

When I click on a cell, it is immediately highlighted (e.g. border of the cell is highlighted) then the cell click event is fired, no matter what I do, I cant get rid of it, any ideas?


1 Reply

RA Rajasekar Syncfusion Team July 18, 2012 05:41 AM UTC

Hi Wang,

 

Thank you for your update.

 

Yes, whenever you click on the any cell, the selection will be drawn immediately to set the current cell  because without setting current cell prior to the Click event, you cannot  access the current cell in the CellClick event of the GridControl. This is our default behavior.

 

Suppose, if you are interested to cancel the selection changes means, then you can achieve this by handling the SelectionChanging event of the GridControl.Model like shown below.

 

        this.grid.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);
 
        void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)
        {   
            e.Cancel = true;
        }

 

Please let us know if you have any queries.

 

Thanks,

Rajasekar


Loader.
Live Chat Icon For mobile
Up arrow icon