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

How to disable click on a cell or do not allow user click on a cell , but still allow horizontall scroll

Hi !

How to disable click on a cell or do not allow user click on a cell , but still allow horizontall scroll

1 Reply

AR Amal Raj U Syncfusion Team November 15, 2016 01:20 PM UTC

Hi Truong, 

Thanks for using Syncfusion products. 
 
 
 
 
 
 
 
 
 
 
How to disable click on a cell or do not allow user click on a cell , but still allow horizontall scroll 
Solution 1 
 
The reported scenario of handling the cell click to disable cell click can be done using the TableControlCurrentCellActivating event and we can scroll using mouse click on ScrollBars as well. Please make use of the below code, 
 
Code Example 
//Event Subscription. 
this.gridGroupingControl1.TableControlCurrentCellActivating += new GridTableControlCurrentCellActivatingEventHandler(gridGroupingControl1_TableControlCurrentCellActivating); 
 
void gridGroupingControl1_TableControlCurrentCellActivating(object sender, GridTableControlCurrentCellActivatingEventArgs e) 
    //To cancel CellClick to avoid cell activating. 
    e.Inner.Cancel = true
Solution 2 
 
Cell click which activates the cell editing can be disabled by making grid as BrowseOnly also. Please make use of the below code, 
 
Code Example 
//To set the grid non-editable using Cell Click. 
this.gridGroupingControl1.BrowseOnly = true; 
 
Note 
Enabling the BrowseOnly of Grid will disable editing of cell only and current cell border will be drawn. 
 
Sample Link 
 
Regards, 
Amal Raj U. 


Loader.
Live Chat Icon For mobile
Up arrow icon