SelectionMode on EJ grid throwing obscure error

Hello,
I'm using the following grid in an MVC project, but am having an issue with the highlighted snippet below. When I try to set the SelectionMode to "Cell", I get the following error:

 "cannot convert from 'Syncfusion.JavaScript.SelectionMode' to System.Action<Syncfusion.JavaScript.SelectionModeBuilder<MpOrderView.Models.OrderResponse>>"

Any help on figuring this out would be greatly appreciated.
Thank You,
Colin Webber

@(
        Html.EJ().Grid<OrderResponse>("MP_WebOrders")
          .Datasource(ds => ds.URL("/Order/GetMPOrders").Adaptor(AdaptorType.UrlAdaptor))
          .EnableAltRow()
          .AllowSorting()
          .AllowPaging()
          .PageSettings(page =>
            page.PageSize(15)
          )
          .AllowMultiSorting()
          .AllowFiltering(true)
          .IsResponsive()
          .SelectionType(SelectionType.Multiple)
          .SelectionSettings(select => {
              select.CellSelectionMode(CellSelectionMode.Box).SelectionMode(SelectionMode.Cell);
          })
          .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.RowDataBound("checkIssueStatus"))
          )

3 Replies

TS Thavasianand Sankaranarayanan Syncfusion Team November 7, 2017 12:41 PM UTC

Hi Colin, 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we have checked your given code example. We are unable to reproduce the reported issue but we are able to reproduce another issue “Cannot convert lambda expression to type 'Syncfusion.JavaScript.Models.SelectionSettings' because it is not a delegate type” from your given code example. So, we suggest you to use the below code example to avoid the issue. 


@(Html.EJ().Grid<OrdersView>("FlatGrid") 
   .Datasource(ds => ds.URL("/Grid/DataSource").Adaptor(AdaptorType.UrlAdaptor)) 
    
    ---- 
 
 
  .SelectionType(SelectionType.Multiple) 
 
   .SelectionSettings(select => { select.SelectionMode(mode => { mode.AddMode(SelectionMode.Cell); }).CellSelectionMode(CellSelectionMode.Box); })   
  
    
   .Columns(col => 
            { 
                 
                ---- 
 
            }) 
    ) 


We have prepared a sample and it can be downloadable from the below location. 


Refer the help documentation. 



If you still face the same issue then provide the following details for better assistance. 

  1. Share the screen shot or video demonstration of the issue.
  2. Share the full stack trace details of your exception.
  3. Essential Studio version details.
  4. If possible share the sample or reproduce the issue in the attached sample. 

Regards, 
Thavasianand S. 



CW Colin Webber November 7, 2017 02:13 PM UTC

Thank you very much, solved the issue perfectly!

Great Product, Great Support!



TS Thavasianand Sankaranarayanan Syncfusion Team November 8, 2017 04:16 AM UTC

Hi Colin, 
 
We are happy that the problem has been solved at your end. 
 
Please get back to us if you need any further assistance.  
 
Regards, 
Thavasianand S. 


Loader.
Up arrow icon