Prevent active text of a cell

Hi everyone
Thank for reading and helping me.

There are attributes that pevent text in cell active, only make this cell click able , so i can CRTL+C to copy value of that cell, it is look like SQL Server table results. I use Readonly attribute but it was not what I expected.

Best Regard.



1 Reply

AA Arulraj A Syncfusion Team October 5, 2018 10:34 AM UTC

Hi Truong, 
 
Thanks for using Syncfusion products. 
 
To make the GridGroupingControl as selectable as MSSQL result table, we suggest you to use the AllowSelection and AllowEdit property and CurrentCellStartEditing event as like in the following code. 

            //Selection Settings 
            this.gridGroupingControl1.TableModel.Options.SelectCellsMouseButtonsMask = System.Windows.Forms.MouseButtons.Left; 
            this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.None; 
            this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any; 
            this.gridGroupingControl1.TableDescriptor.AllowEdit = false; 
 
            this.gridGroupingControl1.TableControl.CurrentCellStartEditing += TableControl_CurrentCellStartEditing; 

        void TableControl_CurrentCellStartEditing(object sender, CancelEventArgs e) 
        { 
            //Cancel the editing of the current cell 
            e.Cancel = true; 
        } 


Please have a look at the following KBs for selection customizations and copy paste options. 

Please let us know if this helps and need any further assistance on this. 
 
Arulraj A 


Loader.
Up arrow icon