How to select the text in cell when double click the cell

I'm using Grid control in asp.net core 2.0 project. I render the Grid control in controller by c# code.

Like the following:

private void InitializeGrid(GridProperties gridModel,string from,string to, string team)
        {
            
            gridModel.AllowPaging = true;
            gridModel.AllowMultipleExporting = true;
            gridModel.AllowMultipleExporting = true;
            gridModel.AllowResizing = true;
            gridModel.AllowFiltering = true;

            Column column1 = new Column() {Field= "QuestionId"};
            Column column2 = new Column() { Field= "CommentOwnerId" };
            Column column3 = new Column() {Field= "CreationDate" };
            Column column4 = new Column() {Field= "Link",Template= "#columnTemplate" };

            List<Column> columns = new List<Column>() { column1,column2, column3, column4 };

            gridModel.Columns = columns;
            
            gridModel.ExportToExcelAction = string.Format("/Home/ExportToExcel?from={0}&to={1}&team={2}",from,to,team);
            PageSettings pageSettings = new PageSettings();
            pageSettings.PageSize = 100;
            gridModel.PageSettings = pageSettings;
            ToolbarSettings toolbarSettings = new ToolbarSettings();
            toolbarSettings.ToolbarItems = new List<string>() { "excelExport" };
            toolbarSettings.ShowToolbar = true;
            gridModel.ToolbarSettings = toolbarSettings;
        }

The Grid can be rendered successfully, but I found that I cannot select the text value in the cell when I double click the cell.

1 Reply

VN Vignesh Natarajan Syncfusion Team June 25, 2018 11:49 AM UTC

Hi Xavier, 

Thanks for using Syncfusion products. 

According to your query we suspect that you want to select the select the Grid cell value while double clicking. We suggest you to disable the Touch functionalities and apply the below highlighted styles to entire grid using CssClass property. 

Refer the below code snippet 

   GridProperties gridModel = new GridProperties(); 
            gridModel.DataSource = order;        
            gridModel.AllowPaging = true; 
            gridModel.EnableTouch = false; 
            gridModel.CssClass = "copyText"; 
            gridModel.AllowMultipleExporting = true; 
……………………………………. 
 
@{Html.EJ().Grid<object>("FlatGrid", Model).Render(); } 
 
<style> 
    .e-grid.copyText .e-rowcell { 
        -moz-user-select: inherit; 
        -khtml-user-select: inherit; 
        -webkit-user-select: text; 
        -ms-user-select: inherit; 
        user-select: inherit; 
    } 
</style> 
 
 

For your convenience we have prepared a sample which can be downloaded from below link   


If we misunderstood your query please get back to us with ore details 

Regards, 
Vignesh Natarajan 



Loader.
Up arrow icon