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

Various Questions

Hi,

  1. How can I copy text in from a cell in the grid without double clicking it (editing it)?
  2. Is there some way of double clicking a column where the text is not fully visible to expand it to the width of the text, similar to excel?
  3. One of the fields in the grid is a DropDownList which is populated from the ViewData, the problem with this is when editing a row, there is a significant delay while loading the items from the ViewData, how can I speed this up? Is there any way of loading the items when the page loads?
Many thanks,

Avi

1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team March 28, 2017 09:41 AM UTC

Hi Avi, 
Thanks for contacting Syncfusion support. 

Query #1: How can I copy text in from a cell in the grid without double clicking it (editing it)? 
We have achieved your requirement by disabling the enableTouch property in Grid. If we disabling the enable touch property, then we can able to select and copy the cell. Please refer to the following code example and sample, 
Code example
@(Html.EJ().Grid<object>("FlatGrid") 
                   . . . 
                   .EnableTouch(false) 
                        .. . . 
                .Columns(col => 
                 { 
                     . . . 
                 }) 
) 
 
 
                                     
Query #2: Is there some way of double clicking a column where the text is not fully visible to expand it to the width of the text, similar to excel? 
We have don’t have support for this “expand it to the width of the text, similar to excel” and we suggest you to use the Edit template feature in Grid. In that feature, we can rendered the different controls such as autocomplete, textarea as well as you can customize the styles for your own control. For your requirement, we suggest you to use textarea in Edit template feature like as follows, 
Code example: 
@Grid 
@(Html.EJ().Grid<object>("FlatGrid") 
               . . . 
                .Columns(col => 
                 { 
                     . . . 
                     col.Field("CustomerID").HeaderText("Customer ID").EditTemplate(a => { a.Create("create").Read("read").Write("write"); }).TextAlign(TextAlign.Right).Width(90).Add(); 
                     . . . 
) 
 
 
@editTemplate 
 
    function create() { 
        return "<textarea class='text' style='width:100%;height:200px' >{{:CustomerID}}</textarea>"; 
    } 
    function read(args) { 
        return args.val(); 
    } 
     
 
 
Please refer to the online demo and Help documentation for more information, 
If we misunderstood your query, then could you please provide more details about your requirement? 
Query #3: one of the fields in the grid is a DropDownList which is populated from the ViewData, the problem with this is when editing a row, there is a significant delay while loading the items from the ViewData, how can I speed this up? Is there any way of loading the items when the page loads? 
We were unable to reproduce the reported issue at our end and we have created a sample based on your convenience which can be download from following link, 
 
In this sample, we have bound the data source for EmployeeID field using ViewData. And if you want to change the data source while editing then we have already discussed this and create a knowledge base documentation. Please refer to the following KB link for more information, 
If you still face the same issue, then could you please provide following details? 
1)      Issue replication procedure. 
2)      Grid code example. 
3)      Issue video. 
4)      A sample if possible or modified the given sample as issue reproducible. 
 
Regards, 
Venkatesh Ayothiraman. 


Loader.
Up arrow icon