Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
142506 | Feb 6,2019 10:02 PM UTC | Feb 8,2019 10:53 AM UTC | ASP.NET Core - EJ 2 | 3 |
![]() |
Tags: DataGrid |
@{
List<object> commands = new List<object>();
commands.Add(new { type = "userstatus", buttonOption = new { content = "Details", cssClass = "e-flat e-details" } }); // custom
}
<div class="control-section">
<ejs-grid id="Grid" dataSource="ViewBag.dataSource" load="load" allowPaging="true">
<e-grid-editSettings allowAdding="false" allowDeleting="false" allowEditing="true"></e-grid-editSettings>
<e-grid-columns>
<e-grid-column field="OrderID" headerText="Order ID" validationRules="@(new { required=true})" isPrimaryKey="true" textAlign="Right" width="100"></e-grid-column>
<e-grid-column field="Verified" headerText="Verified" editType="booleanedit" displayAsCheckBox="true" textAlign="Center" type="boolean" width="100"></e-grid-column>
<e-grid-column headerText="Manage Records" width="150" commands="commands"></e-grid-column>
</e-grid-columns>
</ejs-grid>
</div>
<script>
function load() {
this.columns[2].commands[0].buttonOption.click = function (args) { //click event for custom command button
var grid = document.getElementsByClassName('e-grid')[0].ej2_instances[0]; // grid instance
var rowObj= grid.getRowObjectFromUID(ej.base.closest(args.target, '.e-row').getAttribute('data-uid'));
alert(JSON.stringify(rowObj.data)); // display row data
}
}
</script>
Hi Eugene,
Greetings from Syncfusion.
We have prepared a sample with the given code example but we are unsuccessful to reproduce the issue from our end. Sample can be downloadable from the below location.
Sample: http://www.syncfusion.com/downloads/support/forum/142506/ze/WebApplication1_(7)1718843940.zip
Provide the following details for better assistance from our end.
- Share screen shot or video demonstration of the issue.
- Share the replication procedure to reproduce the issue.
- If possible try to reproduce the issue in the attached sample.
- Share the Essential Studio version details.
Regards,Thavasianand S.
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.
This page will automatically be redirected to the sign-in page in 10 seconds.