Hi kahkasha,
Greetings from syncfusion support
From validating your query, we suspect that you like to display the another datasource in the dialog based on the parent id. Based on your query we have prepared a sample and achieve your requirement by using ajax post. Using this ajax post we have filter the another datasource value based on the ParentID and bind that datasource to the dialog. Please refer the below code example and sample for more information.
|
Index.cshtml
<script>
function commandClick(args) {
var dialog = document.getElementById('defaultDialog').ej2_instances[0];
var dialogGrid = document.getElementById('dialog_grid').ej2_instances[0];
var data = args.rowData;
var row = JSON.stringify({ rowData: [{ OrderID: data.OrderID, CustomerID: data.CustomerID, ShipName: data.ShipName, ShipCity: data.ShipCity, ShipCountry: data.ShipCountry }] });
var ajaxObj = new ej.base.Ajax();
ajaxObj.type = 'POST';
ajaxObj.contentType = 'application/json';
ajaxObj.url = '/Home/SelectRecord';
ajaxObj.data = row;
ajaxObj.send().then(function (value) {
var parsed = ej.data.DataUtil.parse.parseJson(value);
console.log(parsed);
dialogGrid.dataSource = parsed;
dialog.show();
});
}
</script>
|
|
HomeController.cs
public ActionResult SelectRecord(SelectedModel row)
{
var id = row.rowData[0].OrderID;
var data = Emp.GetAllDetails();
var filtered = data.FindAll(e => e.OrderID == id);
return Json(filtered);
} |
Screenshot:
Regards,
Rajapandi R