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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Populating a grid locally

Thread ID:





109264 Jun 5,2013 09:03 AM UTC Jun 11,2013 10:26 AM UTC ASP.NET MVC (Classic) 1
Tags: Grid
Andrea Bioli
Asked On June 5, 2013 09:03 AM UTC

I didn't have the time to excercise with the trial, but I would like to know if with this grid it's possible to populate a local grid with data coming from the server.
To make an example, let's suppose that I have a table on the server with the possible hobbies. On the client, the user can insert a record about himself (name, birthday, etc.) *and* add the list of his hobbies, choosing from the server.
Technically speaking, I think we can call it 'model binding to a collection attribute'. All happens in the client, and when the user submit the form, in the controller I have all the data, including the list. Is it possible?
Thanks in advance

Satheeskumar S [Syncfusion]
Replied On June 11, 2013 10:26 AM UTC

Hi Andrea,

Thanks for your interest in Syncfusion products.

We glad to inform you that your requirement can be achieved using the below code snippet.

<script type="text/javascript">

            $('#DialogEditSave').click(function ()
                    var select = $('#Hobby');
                var arr = [];    
                $('#Hobby option:selected').each(function ()



    @Html.ListBox("Hobby", ViewData["hobbieslist"] as MultiSelectList)



public ActionResult OrderSave(EditDetails ord, string[] Hobbies)
         string hoby=string.Join("", Hobbies);
         ViewData["hobbieslist"] = GetHobbies(hoby.Split(','));
         ord.Hobby = hoby;    
         var data = DetailsRepository.GetAllRecords();
         return data.GridJSONActions<EditDetails>();

For your convenience we have attached a sample. Could you use that sample and get back to us if you have any queries.

Let us know if you have any concerns.

Satheeskumar 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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon