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.
Unfortunately, activation email could not send to your email. Please try again.

Enable Postback for the Grid

Thread ID:

Created:

Updated:

Platform:

Replies:

117991 Jan 16,2015 07:02 PM Jan 21,2015 11:04 AM ASP.NET MVC 3
loading
Tags: Grid
Bruce Gilham
Asked On January 16, 2015 07:02 PM

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

Balaji Marimuthu [Syncfusion]
Replied On January 19, 2015 09:21 AM

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



Bruce Gilham
Replied On January 20, 2015 03:38 AM

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.



Balaji Marimuthu [Syncfusion]
Replied On January 21, 2015 11:04 AM

Hi Bruce,

Thanks for your update.

Please let us know if you have any other queries.

Regards,

Balaji Marimuthu



CONFIRMATION

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.

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.

;