PDA

View Full Version : [CLOSED] Remove data from GridPanel



gs_user
May 30, 2012, 11:51 PM
Hi,
I have Two Grid, Add A Grid data to B Grid,
After add data, the data have to remove
I try it , but can't work



<ext:ImageButton ID="ib_add1" runat="server" X="270" Y="50" ImageUrl="images/arrow_right.jpg">
<DirectEvents>
<Click OnEvent="AddSignEmp">
<ExtraParams>
<ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel13}.getRowsValues({selectedO nly : true}))"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:ImageButton>




protected void AddSignEmp(object sender, DirectEventArgs e)
{

string json = e.ExtraParams["Values"];

Dictionary<string, string>[] companies = JSON.Deserialize<Dictionary<string, string>[]>(json);

XmlNode xml = JSON.DeserializeXmlNode("{records:{record:" + json + "}}");


RowSelectionModel sm = this.GridPanel13.GetSelectionModel() as RowSelectionModel;

StringBuilder sb = new StringBuilder();



foreach (XmlNode row in xml.SelectNodes("records/record"))
{
string s1 = row.SelectSingleNode("col01").InnerXml;
string s6 = row.SelectSingleNode("col02").InnerXml;
string s2 = row.SelectSingleNode("col03").InnerXml;

my_FILE my_FILE = new my_FILE();
my_FILE.col01= s1;
my_FILE.col02= s6;
my_FILE.col03= s1;
Stdep12.Add(my_FILE); // it can add data
Stdep1.Remove(my_FILE); // remove is invalid

}


}

Vladimir
May 31, 2012, 9:16 AM
Please investigate the following sample
http://examples2.ext.net/#/GridPanel/Miscellaneous/Two_Grids/