View Full Version : [CLOSED] How to read rows in gridpanel or store from codebehind

Dec 10, 2014, 4:59 PM

I want to read de rows in the gridpanel or store from code behind, this is for get the information in each rows and save into the database.

That is for this:

1.- Load the gridpanel with data
2.- Select a row and up or down the position of that.
3.- Update the position of all rows changed in the database.

thanks a lot.

Dec 11, 2014, 7:32 AM
Hi @opendat2000,

This example demonstrates how to submit a GridPanel's data to server.

Dec 11, 2014, 7:43 AM
.aspx Design Code:

<ext:Button ID="Button1" runat="server" Text="Submit two grids">
<Click OnEvent="SubmitGrids">
<ext:Parameter Name="Grid1" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOn ly : false}))" Mode="Raw" />

.cs Code:

string grid1Json = e.ExtraParams["Grid1"];
XmlNode grid1Xml = JSON.DeserializeXmlNode("{records:{record:" + grid1Json + "}}");
Dictionary<string, string>[] grid1Data = JSON.Deserialize<Dictionary<string, string>[]>(grid1Json);
foreach (IDictionary<string, string> JColumn in grid1Data)
//whatever you want,code here

Dec 11, 2014, 4:26 PM
Thanks to both for the replies.

Now I can get the data.

Please close the thread.

Again Thanks to both.