[CLOSED] Checkbox Selected Rows in GridPanel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [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.
    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]

Similar Threads

  1. [CLOSED] How to get selected rows count in gridpanel
    By egvt in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 31, 2012, 5:22 PM
  2. Replies: 1
    Last Post: Oct 13, 2010, 11:09 PM
  3. [CLOSED] How to set all rows as selected in GridPanel
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 30, 2010, 4:42 PM
  4. Replies: 2
    Last Post: Dec 25, 2009, 2:56 PM
  5. [CLOSED] Get selected rows in GridPanel
    By danielg in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 24, 2009, 12:48 PM

Tags for this Thread

Posting Permissions