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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to allow copying of cell data in ASP.NET MVC

Thread ID:

Created:

Updated:

Platform:

Replies:

132019 Aug 8,2017 05:34 PM UTC Aug 10,2017 01:54 AM UTC ASP.NET MVC 1
loading
Tags: Grid
Colin Webber
Asked On August 8, 2017 05:34 PM UTC

I have the following Grid written in ASP.NET MVC and can not for the life of me figure out how to enable the copying of cell data in the current configuration. Any help would be greatly appreciated.
[code]
@(Html.EJ().Grid<OrderResponse>("MP_WebOrders")
          .Datasource(ds => ds.URL("/Order/GetMPOrders").Adaptor("UrlAdaptor"))
          .EnableAltRow()
          .AllowSorting()
          .ScrollSettings(scroll => scroll.Height("auto").Width("auto"))
          .AllowMultiSorting()
          .AllowFiltering(true)
          .IsResponsive()
          .SelectionType(SelectionType.Single)
          .SelectionSettings(select =>
          {
              select.CellSelectionMode(CellSelectionMode.Box).SelectionMode(new List<SelectionMode>() { SelectionMode.Cell });
          })
          .AllowSelection()
          .EditSettings(edit => { edit.AllowAdding().AllowDeleting(); })
          .SortSettings(sort =>
          {
              sort.SortedColumns(col => col.Field("OrderDate").Direction(SortOrder.Descending).Add());
              sort.SortedColumns(col => col.Field("InternalOrderID").Direction(SortOrder.Descending).Add());
          })
          .Columns(col =>
          {
              col.Field(c => c.IntegrationOrderId).IsPrimaryKey(true);
              col.Field(c => c.ExternalSystemName).HeaderText("External System").TextAlign(TextAlign.Left).Width(125).Add();
              col.Field(c => c.InternalOrderID).HeaderText("System Order ID").TextAlign(TextAlign.Left).Width(125).Add();
              col.Field(c => c.ERPOrderNumber).HeaderText("MAS Order Number").TextAlign(TextAlign.Left).Width(125).Add();
              col.Field(c => c.OrderStatus).HeaderText("Order Status").TextAlign(TextAlign.Left).Width(125).Add();
              col.Field(c => c.OrderTrackingNumber).HeaderText("Tracking Number").TextAlign(TextAlign.Left).Width(125).Add();
              col.Field(c => c.OrderDate).HeaderText("Order Date").Format("{0:MM/dd/yyyy}").TextAlign(TextAlign.Left).Width(125).Add();
              col.Field(c => c.OrderTotalPrice).Format("{0:C}").HeaderText("Order Total").TextAlign(TextAlign.Right).Width(125).Add();
              col.Field(c => c.LastUpdated).Format("{0:MM/dd/yyyy}").HeaderText("Last Updated").TextAlign(TextAlign.Left).Width(125).Add();
          })
          .ClientSideEvents(eve => eve.QueryCellInfo("checkIssueStatus")
          )
        )
[/code]

Prasanna Kumar Viswanathan [Syncfusion]
Replied On August 10, 2017 01:54 AM UTC

Hi Colin, 

Thanks for contacting Syncfusion support. 

By default, user-select property will be set to none in the ejGrid. If you would like to disable this, you must override this property in the Grid. This can be achieved by using the CssClass property of the Grid. 

Find the code example and sample:  


@(Html.EJ().Grid<object>("FlatGrid") 
    .Datasource((IEnumerable<object>)ViewBag.datasource) 
 
    -----------------         
    .CssClass("copyText") 
    .Columns(col => 
     { 
        ---------------------- 
    }) 
  ) 
 
----------------------------- 
<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> 



Regards, 
Prasanna Kumar N.S.V 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;