[CLOSED] GridPanel - Check rows in server side

  1. #1

    [CLOSED] GridPanel - Check rows in server side

    Hi,

    I had a panelgrid with CheckboxSelectionModel.
    I need a help to check a rows from my gridpanel in server side.
    I tried this code, but didn?t work.

    foreach (Class.Type objtype in existTypes)
                        {
                            int idType = objtype.IdType;
                            //this doesn?t work
                            GridPanelType.Listeners.ViewReady.Handler = "this.getSelectionModel().selectRow(" + idType + ");";
    
                        }
    My code:

    <--this works

    protected void LoadGridTypes()
            {
                Store store = this.GridPanelType.GetStore();
                store.DataSource = new object[]
                        {
                            new object[] { "0", "finance" },
                            new object[] { "1", "hr" },
                            new object[] { "2", "it" },
                            new object[] { "3", "account" },
                        };
                store.DataBind();
    
            }
    <--this works
    <ext:GridPanel 
                        ID="GridPanelType" 
                        runat="server"
                        MultiSelect="true"
                        Flex="1"
                        Margins="0 0 0 3"
                        >
                        <Store>
                            <ext:Store ID="Store4" runat="server">
                                <Model>
                                    <ext:Model ID="Model4" runat="server">
                                        <Fields>
                                            <ext:ModelField Name="Id" />
                                            <ext:ModelField Name="Type" />
                                        </Fields>
                                    </ext:Model>
                                </Model>
                            </ext:Store>
                        </Store>
                        <ColumnModel runat="server">
                            <Columns>
                                <ext:Column ID="Type" runat="server"  Width="115" DataIndex="Type" Text="Type"/>
                                <ext:Column ID="Id" runat="server" Width="60" DataIndex="Id" Visible="false"/>
                            </Columns>
                        </ColumnModel>
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" Mode="Multi" />
                        </SelectionModel>  
                    </ext:GridPanel>
                </Items>
            </ext:Panel>

    thank you in advance.
    Last edited by Daniil; Jul 31, 2014 at 5:31 AM. Reason: [CLOSED]
  2. #2
  3. #3
    Hi Vladimir,
    thank you for your atention, but is not what I?m looking for.
    I already got the elements checked, now I?m reading my data base and I have to check the options again, server side.
    I searched in all Ext samples, but I didn?t find any sample that demonstrate this.

    Can you help me?

    Thank you.
  4. #4
    I have to check the options again, server side.
    I guess that online sample demonstrates it already
    https://examples2.ext.net/#/GridPane...Row_Selection/

    If yoo need to change selection on the server side then use SelectedRows collection of selection model and call UpdateSelection
    protected void Add_Click(object sender, DirectEventArgs e)
        {
            RowSelectionModel sm = this.GridPanel1.GetSelectionModel() as RowSelectionModel;
            sm.SelectedRows.Add(new SelectedRow("Boeing Co."));
            sm.UpdateSelection();
        }
  5. #5
    Ok Vladimir,

    Now it is working.

    Thank you.

Similar Threads

  1. Replies: 3
    Last Post: Apr 17, 2013, 4:23 AM
  2. To loop GridPanel rows server side
    By nanomusty in forum 1.x Help
    Replies: 7
    Last Post: Jun 28, 2012, 1:24 PM
  3. Replies: 1
    Last Post: Apr 01, 2012, 3:42 PM
  4. [CLOSED] Can I Check UnCheck in Tree Panel from Server Side
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 28, 2011, 10:30 AM
  5. Replies: 1
    Last Post: May 05, 2010, 1:47 PM

Tags for this Thread

Posting Permissions