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
close icon

How to Update Child Grid on Master Grid Selction Event

hello,

i have use grid in razor view, but i m not able to update child grid on master grid selection event. or also not able to open Sycfusion dialog on Master Grid Click event.can you please provide a sample application for that.or let us know me how i can do this


1 Reply

ES Eswari S Syncfusion Team September 15, 2011 11:53 AM UTC

Hi Shivkumar,

Thank you for using Syncfusion products.

Query #1 : child grid on master grid selection event

Your requirement can be achieved by using ClientSideRecordSelectionEvent event.Please refer to the following code snippets:

[Index.cshtml]

@{ Html.Grid("custGrid").Datasource((IEnumerable)ViewData["CustData"])
. . . .
.ClientSideRecordSelectionEvent("OnRecordSelect") // record selection event

.Render();
}

[JavaScript]



[Controller]

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Orders(string CustomerId)
{
var OrderData = new NorthwindDataContext().Orders.Where(s => s.CustomerID == CustomerId).Take(6).ToList();
ViewData["orderdata"] = OrderData;
return PartialView("Orders", this.ViewData);

}

Also ,we would request you to check the online sample link :

http://mvc.syncfusion.com/sfmvcsamplebrowser/9.3.0.61/Grid_MVC/Samples/4.0/Razor/ProductShowCase/ParentChild


Query #2: Syncfusion dialog on Master Grid


Your requirement can be achieved by using ClientSideRecordSelectionEvent event. Please refer to the following code snippets:

[Dialog.cshtml]

@{ Html.Grid("custGrid").Datasource((IEnumerable)ViewData["CustData"])
. . . .
.ClientSideRecordSelectionEvent("DialogOpen") // record selection event

.Render();
}

[JavaScript]



For your convenience, we have prepared the sample and the same can be downloaded from the following link:

Sample43258867.zip

Note : In sample ,click Dialog with Grid hyperlink to open the page with dialog.

Please try this and let us know if you need any further assistance.

Regards,
Eswari.S




Loader.
Live Chat Icon For mobile
Up arrow icon