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.

Update multiple rows at a time

Thread ID:

Created:

Updated:

Platform:

Replies:

118796 Apr 9,2015 08:50 PM Apr 13,2015 10:26 AM ASP.NET MVC 5
loading
Tags: Grid
minh
Asked On April 9, 2015 08:50 PM

Hi,
I just started using Syncfusion. By far, I'm practicing with the default samples in which update button is enabled when I click on 1 row and disabled after I'm done editing in that row. So my questions are:
1. How can I keep the Update button enabled so I can edit multiple rows and it's only disabled when I actually click it?
2. What is the code to refresh the grid because I might need to use it in jquery at some points.
Thanks

minh
Replied On April 9, 2015 09:12 PM

Just one addition to my question above, how can I attach an Action method to the Delete or Update button so the Action method would be invoked accordingly? I'm thinking of calling Ajax but I think there would be a faster way...

Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 10, 2015 08:37 AM

Hi Minh,

Thanks for using Syncfusion Products.

Query 1 : “How can I keep the Update button enabled so I can edit multiple rows and it's only disabled when I actually click it?”

We suggest you to use batchEditing feature for the above query. In batch editing we can able to edit multiple rows and we can update all the edited records at one time.

Please refer the below online sample for batch editing feature:

Link : http://mvc.syncfusion.com/demos/web/grid/batchediting

For your convenience we have created a sample and sample can be downloaded from the below link

Query 2 : “What is the code to refresh the grid because I might need to use it in jquery at some points”

To refresh the grid, we suggest you to use refreshContent method in ejGrid.

We have already created a UG documentation for the refreshContent api. So, please refer the below link

Link : http://help.syncfusion.com/UG/JS_CR/ejGrid.html#refreshContent

Query 3 : “how can I attach an Action method to the Delete or Update button”

For this query, we suggest you to use URL Adaptor or remoteSave Adaptor. We can map CRUD operation inGridto Server-Side Controller action using the properties “InsertURL”, “UpdateURL” and “RemoveURL. In the below attached sample, we use batchediting with URL Adaptor and for batchediting with URL Adaptor and for batcheditingwe map CRUD operation using the property Batch URL.

Please find the below code snippet :

@(Html.EJ().Grid<MvcApplication14.OrdersView>("FlatGrid")

.Datasource(ds => ds.URL("BatchDataSource").BatchURL("BatchUpdate").Adaptor(AdaptorType.UrlAdaptor))

.AllowPaging() /*Paging Enabled*/

.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch); })

.ToolbarSettings(toolbar =>

{

toolbar.ShowToolbar().ToolbarItems(items =>

{

items.AddTool(ToolBarItems.Add);

items.AddTool(ToolBarItems.Edit);

items.AddTool(ToolBarItems.Delete);

items.AddTool(ToolBarItems.Update);

items.AddTool(ToolBarItems.Cancel);

});

})

.Columns(col =>

{

col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();

col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add();

col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(75).Add();

col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).Format("{0:C}").Add();

col.Field("OrderDate").HeaderText("Order Date").TextAlign(TextAlign.Right).Width(80).Format("{0:MM/dd/yyyy}").Add();

col.Field("ShipCity").HeaderText("Ship City").Width(110).Add();

}))

We have already created a UG documentation for the URL Adaptor and remoteSave Adaptor. Please refer the below link for the UG documentation

Link : http://help.syncfusion.com/ug/js/index.html#!Documents/crudoperationwithserverside.htm

Sample Link : http://www.syncfusion.com/downloads/support/forum/118796/Sample-1432307345.zip

Please get back to us if you have any further assistance on this,

Regards,

Prasanna Kumar N.S.V


minh
Replied On April 10, 2015 12:19 PM

Hi,
Thanks for your reply. I think your link in query 2 for refreshing content is not working. Can you please refer me to other one?

minh
Replied On April 10, 2015 12:23 PM

And also the link in query 3 for crud operation with server side is not working too. Can you please fix that?              

Prasanna Kumar Viswanathan [Syncfusion]
Replied On April 13, 2015 10:26 AM

Hi Minh,

Sorry for the inconvenience caused.

Please refer the below link for UG documentation link:

Link : http://help.syncfusion.com/cr/js

Please follow the steps for the refreshContent Api:

Steps : ejGrid -> Methods -> refreshContent

Please refer the below link for UG documentation of URL Adaptor and remoteSave Adaptor

Link : http://help.syncfusion.com/web

Please follow the steps for the documentation

Steps : Grid -> Concepts and Features -> Editing -> CRUD Operation With Server-Side

Please get back to us if you have any further assistance on this,

Regards,

Prasanna Kumar N.S.V


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.

;