Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

ASPxGridView - How to save selected rows to the database by using WebMethods

$
0
0

This example shows how to save and retrieve selection state of the row. It is realized by using WebMethods. On page loading, selection state is retrieved from the database and ASPxGridView rows are selected by the SetSelection method. When a row is selected, the client-side ASPxClientGridView.SelectionChanged event is raised and the UpdateDB method is called. This method updates a database.
On the client side, WebMethod is called by

[JScript]
PageMethods.UpdateDB(array);

On the server side, ScriptManager is used with EnablePageMethods set in "True".

[ASPx]
<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePageMethods="true"></asp:ScriptManager>

and the C# method is marked by WebMethodAttribute 

[C#]
usingSystem.Web.Services; [WebMethod]publicstaticvoidUpdateDB(object[]array){//method code}

 

See also:
ASPxGridView - How to save selected rows to the database when ProcessSelectionChangedOnServer is True
How to track progress of server side processing on the client side (using WebMethods)


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>