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

Populating a grid locally

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

1 Reply

SS Satheeskumar S Syncfusion Team 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


Live Chat Icon For mobile
Up arrow icon