gridpanel RowSelectionModel.SelectedRows does not work

Page 1 of 2 12 LastLast
  1. #1

    gridpanel RowSelectionModel.SelectedRows does not work

    hi

    I got a problem when using gridpanel RowSelectionModel SelectedRows
    I'd like to set some rows of gridpanel selected,code as below
                
    RowSelectionModel sm = this.grdPrice.SelectionModel.Primary as RowSelectionModel;
                //clear select row
                sm.SelectedRows.Clear();
                sm.UpdateSelection();
                //get select row index
                sm.SelectedRows.Add(new SelectedRow(0));
                sm.SelectedRows.Add(new SelectedRow(12));
                sm.UpdateSelection();
    gridpanel pagesize =10
    total row count =20
    but only row 0 which in page 1 was selected . the row 12 which in page 2 can't change state to be seleted

    Sorry for my pool english ,does anyone understand the problem describled above ?
    my ext.net version (1.3)
    Last edited by dew3083142; Mar 28, 2012 at 8:17 AM.
  2. #2
    Hi,

    Welcome to Ext.NET!

    You should set up IDProperty for Store Reader to get it working through rest (not current) pages.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    Welcome to Ext.NET!

    You should set up IDProperty for Store Reader to get it working through rest (not current) pages.
    hi daniil

    I have set up the IDProperty ,but the row (rowindex is 12) is still unselected,my code as below.
    Would you kindly to help to review it?
    ASPX:
        <ext:GridPanel ID="grdPrice" runat="server" Height="320" Frame="true" StripeRows="true"
            TrackMouseOver="true">
            <Store>
                <ext:Store ID="Store1" runat="server">
                    <Reader>
                        <ext:JsonReader IDProperty="ID">
                            <Fields>
                                <ext:RecordField Name="SPM_NO" />
                                <ext:RecordField Name="ZEILE_A" />
                                <ext:RecordField Name="ALLOC_GROUP" />
                                <ext:RecordField Name="MATNR" />
                            </Fields>
                        </ext:JsonReader>
                    </Reader>
                </ext:Store>
            </Store>
            <ColumnModel>
                <Columns>
                    <ext:Column Header="No" DataIndex="ZEILE_A" Width="35" />
                    <ext:Column Header="Alloc.Group" DataIndex="ALLOC_GROUP" Width="70" />
                    <ext:Column Header="Material No" DataIndex="MATNR" Width="110" />
                    <ext:Column Header="SPM_NO" DataIndex="SPM_NO" />
                </Columns>
            </ColumnModel>
            <LoadMask ShowMask="true" />
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModel1" runat="server">
                </ext:RowSelectionModel>
            </SelectionModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" DisplayInfo="true"
                    HideRefresh="true" DisplayMsg="Displaying Records {0} - {1} of {2}" EmptyMsg="No Records to display" />
            </BottomBar>
        </ext:GridPanel>
    code behind
    
                RowSelectionModel sm = this.grdPrice.SelectionModel.Primary as RowSelectionModel;
                sm.SelectedRows.Add(new SelectedRow(0));
                sm.SelectedRows.Add(new SelectedRow(12));
                sm.UpdateSelection();
  4. #4
    What data do you bind to the Store?
  5. #5
    data table
  6. #6
    Is there ID column?
  7. #7
    no ,there isn't a column names 'ID' in the datatable
  8. #8
    Quote Originally Posted by Daniil View Post
    Is there ID column?
    Do you means the IDproperty should be one column of the datatable?
    I also try that ,but all the same
  9. #9
    Quote Originally Posted by dew3083142 View Post
    Do you means the IDproperty should be one column of the datatable?
    Yes.

    Quote Originally Posted by dew3083142 View Post
    I also try that ,but all the same
    Are there unique values?

    Please pvovide a full example to reproduce the problem.
  10. #10
    HI Daniil

    I have send the full sample code to support@object.net ,pls check it .

    Thank you very much


    column 'ZEILE_A' is unique value
    Last edited by dew3083142; Mar 28, 2012 at 2:13 PM.
Page 1 of 2 12 LastLast

Similar Threads

  1. [CLOSED] How to get selectedrows of gridpanel
    By egvt in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 31, 2012, 8:10 PM
  2. [CLOSED] [1.0] GridPanel and RowSelectionModel
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Feb 11, 2010, 3:30 PM
  3. GridPanel RowSelectionModel firing
    By moth1 in forum 1.x Help
    Replies: 0
    Last Post: Jun 19, 2009, 1:19 AM
  4. [CLOSED] GridPanel RowSelectionModel
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 09, 2009, 10:48 AM
  5. Replies: 0
    Last Post: Dec 29, 2008, 9:19 AM

Tags for this Thread

Posting Permissions