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

Enable Postback for the Grid

Hello All,

I may be using the wrong control to do this, I'm adding the grid to a CMS that is using ASP.MVC 5, but the management pages are using post backs to persist their data.  I have the grid rendering the data from the underlying object.  But I'm not getting any postback data from the grid.  Can I enable the Grid to post back the data?

Thanks

B

3 Replies

BM Balaji Marimuthu Syncfusion Team January 19, 2015 02:21 PM UTC

Hi Bruce,

Thanks for using Syncfusion Products.

We have analyzed your requirement and achieved by using “UrlAdaptor” for sent the postback to the server. Please find the below code snippet.

[view]

@(Html.EJ().Grid<RemoteServerAdaptorSample_129241.Models.Order>("Editing")

        .Datasource(ds => ds.URL("Home/Data").UpdateURL("Home/Update").Adaptor("UrlAdaptor"))       

         . . . .

)

[Controller]

public ActionResult Data(DataManager dm)

        {

            var DataSource = OrderRepository.GetAllRecords();

            DataResult ds = new DataResult();

            ds.result = DataSource.Skip(dm.Skip).Take(dm.Take);

            ds.count = DataSource.Count;

            return Json(ds, JsonRequestBehavior.AllowGet);

        }

Please refer the online documentation for urlAdaptor as follows:

http://help.syncfusion.com/ug/js/default.htm#!documents/crudoperationwithser.htm

For your reference we have attached the sample and the same can be downloaded from the link

http://www.syncfusion.com/downloads/support/directtrac/117991/Urladaptor-330385755.zip

Please let us know if you have any queries.

Regards,

Balaji Marimuthu




BG Bruce Gilham January 20, 2015 08:38 AM UTC

Thank you for your response.

Ajax isn't available for this project.

I found another solution using knockout.js to store the data and then writing the entities out to hidden form fields which than are sent to the server on a page post back.




BM Balaji Marimuthu Syncfusion Team January 21, 2015 04:04 PM UTC

Hi Bruce,

Thanks for your update.

Please let us know if you have any other queries.

Regards,

Balaji Marimuthu



Loader.
Live Chat Icon For mobile
Up arrow icon