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

Grid - Documentation is Incomplete

Hi, trying to get a grid set up with editing, and I'm unable to find complete references for the editType property and the edit params as well (referenced here:https://ej2.syncfusion.com/16.1.24/aspnet/documentation/grid/edit.html?syntax=tag#cell-edit-type-and-its-params)

"params" is a reserved word in c#, so your example code is wrong -- it doesn't compile as stated.

What other edit types are available? Is there a datepicker option? Can you get the params bit corrected and fully documented so we know what options are available, especially for the drop down editor? How do I get the drop down to bind to a list of data in my View Model for example?

1 Reply

VA Venkatesh Ayothi Raman Syncfusion Team March 12, 2018 10:02 AM UTC

Hi Rob, 

Thanks for using Syncfusion products. 
Query #1:” params" is a reserved word in c#, so your example code is wrong -- it doesn't compile as stated 
We have considered this “Cell edit type and params documentation code example is incorrect” as Documentation task and it will be updated on live in upcoming releases. 
Query #2:” What other edit types are available? 
We have following editTypes in Grid, 
1)      NumericEdit 
2)      DropdownEdit 
3)      DatepickerEdit 
4)      BooleanEdit 
Note: We will update the Grid Cell edit types in that documentation.  
Query #3:”Datepicker editType” 
Yes, we have EditType for date columns as named datapickeredit. Please refer to the following code example, 
<ejs-grid id="Grid" dataSource="ViewBag.DataSource" height="315" allowPaging="true"> 
    <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings> 
    <e-grid-columns> 
        . .  . 
        <e-grid-column field="OrderDate" headerText="Order Date" width="150" type="date" editType="datepickeredit" format="yMd"></e-grid-column> 
    </e-grid-columns> 
</ejs-grid> 
 
Query #4:” Can you get the params bit corrected and fully documented so we know what options are available, especially for the drop down editor? 
We have built-in support for dropdown edit type in Grid. Please refer to the following code example, 
@{ 
 
    var editParams = new { @params = new { value = "Germany" } }; 
    
  } 
<ejs-grid id="Grid" dataSource="ViewBag.DataSource" height="315" allowPaging="true"> 
    <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings> 
    <e-grid-columns> 
. .  . 
        <e-grid-column field="ShipCountry" headerText="Ship Country" editType="dropdownedit" edit="editParams" width="150"></e-grid-column> 
         
    </e-grid-columns> 
</ejs-grid> 
 
Query #5:” How do I get the drop down to bind to a list of data in my View Model for example? 
 
As from your query, we suspect that do you want to bound the custom data source for Dropdown list while editing the Grid. If so, we have achieved your requirement using same edit params feature. Please refer to the following code example, 
@{ 
 
    var editParams = new { @params = new { dataSource = ViewBag.dropdown, fields = new {  value = "ShipCountry" } } };  
 
} 
 
<ejs-grid id="Grid" dataSource="ViewBag.DataSource" height="315" allowPaging="true"> 
    <e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true"></e-grid-editSettings> 
    <e-grid-columns> 
. .  . 
        <e-grid-column field="ShipCountry" headerText="Ship Country" editType="dropdownedit" edit="editParams" width="150"></e-grid-column> 
              .  .  .         
    </e-grid-columns> 
</ejs-grid> 
 
[Controller] 
  public IActionResult Index() 
        { 
            .  .  . 
            List<object> dd = new List<object>(); 
            dd.Add(new { ShipCountry = "Denmark" }); 
            dd.Add(new { ShipCountry = "Brazil"  }); 
            dd.Add(new { ShipCountry = "Germany"  }); 
            dd.Add(new { ShipCountry = "Austria" }); 
            dd.Add(new { ShipCountry = "Switzerland" }); 
            ViewBag.dropdown = dd; 
            return View(); 
        } 
 
Note: We will update the Grid Cell edit types in that documentation. Until please refer to the above code example. 
We have also prepared a sample for your convenience which can be download from following link, 

In that sample, we have enabled the EditType as follows Dropdownedit and Datepicker. 

Regards, 
Venkatesh Ayothiraman. 


Loader.
Live Chat Icon For mobile
Up arrow icon