PDA

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



opendat2000
Dec 10, 2014, 4:59 PM
Hi,

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.

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

This example demonstrates how to submit a GridPanel's data to server.
http://examples2.ext.net/#/GridPanel/Miscellaneous/Submit_Two_Grids/

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


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

.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
}

opendat2000
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.