Aug 17, 2010, 4:27 AM
[CLOSED] Checkbox Selected Rows in GridPanel
Hi,
The following process used to get selected rows [if click on Check Box] from GridPanel in Code Behind. I cant able to get selected rows using this source.
I will call confirm from code behind to check some validation.
The following source i have used in ASPX page.
Please help me to fix this process
The following process used to get selected rows [if click on Check Box] from GridPanel in Code Behind. I cant able to get selected rows using this source.
I will call confirm from code behind to check some validation.
The following source i have used in ASPX page.
function Export() {
GridData.setValue(Ext.encode(GridPanel1.getRowsValues(true, false, false, false)));
}
function Confirm() {
Export();
btn_confirm.fireEvent('click');
}
<ext:StoreID="St1"runat="server">
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordFieldName="NO">
</ext:RecordField>
<ext:RecordFieldName="DESC">
</ext:RecordField>
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
<ext:GridPanelID="GridPanel1"runat="server"StoreID="St1"StripeRows="true"
Height="68"Header="false"Width="280"Border="true"AutoScroll="true">
<ColumnModel>
<Columns>
<ext:ColumnDataIndex="NO"Header="No"ColumnID="NO"Hidden="true">
</ext:Column>
<ext:ColumnDataIndex="DESC"Header="Kind"ColumnID="DESC"Hidden="false"
Width="230">
</ext:Column>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:CheckboxSelectionModelID="CheckboxSelectionModel1"runat="server">
</ext:CheckboxSelectionModel>
</SelectionModel>
</ext:GridPanel>
<ext:ButtonID="btn_confirm"runat="server"Hidden="true">
<AjaxEvents>
<ClickOnEvent="BeforeConfirm"ShowWarningOnFailure="false"Timeout="120000">
</Click>
</AjaxEvents>
</ext:Button>
<ext:HiddenID="GridData"runat="server">
</ext:Hidden>
The following source i have used in code behind.public void BeforeConfirm(object sender, AjaxEventArgs e)
{
string gridJson = GridData.Value.ToString();
Dictionary<string, string>[] dic = JSON.Deserialize<Dictionary<string, string>[]>(gridJson);
string strAdd = string.Empty;
string strTempNo = string.Empty;
string strTempDesc = string.Empty;
foreach (Dictionary<string, string> row in dic)
{
row.TryGetValue("NO", out strTempNo);
row.TryGetValue("DESC", out strTempDesc);
}
}
When i use this source to get the value from gridpanel. But It is not working to returns the selected rows.Please help me to fix this process
Last edited by geoffrey.mcgill; Aug 18, 2010 at 5:43 PM.
Reason: [CLOSED]