A problem about comboBox in a GridRow

Hybrid View

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

    A problem about comboBox in a GridRow



    Hi, dear friends.


    I've got a problem recently that needs your help.


    I have a gridpanel with first 5 columns binded to a Store named "Store1" and the 6th column a comboBox binded to "StorePurchaser". Please see code below:

    <ext:GridPanel ID="GridPanel2" runat="server" AutoExpandColumn="Id" StoreID="Store1"
        AutoWidth="False" AutoExpandMin="0">
        <ColumnModel ID="ColumnModel5" runat="server">
            <Columns>
                <ext:Column Header="State" Sortable="true" DataIndex="State" Width="40" Fixed="True">
                    <Renderer Fn="RTState" />
                </ext:Column>
                <ext:Column ColumnID="Id" DataIndex="Id" Header="Order ID" Width="80" Fixed="False" />
                <ext:Column DataIndex="ClientName" Header="Client Name" />
                <ext:Column DataIndex="SalesName" Header="Employ Name">
                </ext:Column>
                <ext:Column DataIndex="StartDate" Header="Start Time" Width="100">
                    <Editor>
                        <ext:DateField ID="DateField1" runat="server" />
                    </Editor>
                </ext:Column>
                <ext:Column DataIndex="DueDate" Header="Due Date" Width="100" />
                <ext:Column Header="Assign" Width="100" DataIndex="Space" ColumnID="ClPurchaser"
                    Hidden="true">
                    <Editor>
                        <ext:ComboBox ID="ComboBox1" runat="server" StoreID="StorePurchaser" TypeAhead="true"
                            Mode="Local" ForceSelection="true" TriggerAction="All" DisplayField="Name" ValueField="Name"
                            EmptyText="Select Purchaser" ValueNotFoundText="Select a purchaser.">
                        </ext:ComboBox>
                    </Editor>
                </ext:Column>
            </Columns>
        </ColumnModel>
        <Buttons>
            <ext:Button ID="Button2" runat="server" Text="Reload">
                <AjaxEvents>
                    <Click OnEvent="Store1_Refresh" />
                </AjaxEvents>
            </ext:Button>
            <ext:Button ID="Button4" runat="server" Text="Assign" Visible="false">
                <AjaxEvents>
                    <Click OnEvent="BtnAssign_Click">
                        <ExtraParams>
                            <ext:Parameter Name="CORowCount" Value="Store1.getCount()" Mode="Raw" />
                        </ExtraParams>
                    </Click>
                </AjaxEvents>
            </ext:Button>
        </Buttons>
        <SelectionModel>
            <ext:RowSelectionModel ID="rowselectionmodel5" runat="server" SingleSelect="true">
                <AjaxEvents>
                    <RowSelect OnEvent="RowSelect" Buffer="250">
                        <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="#{ContentPanl}" />
                        <ExtraParams>
                            <ext:Parameter Name="Id" Value="this.getSelected().id" Mode="Raw" />
                        </ExtraParams>
                    </RowSelect>
                </AjaxEvents>
            </ext:RowSelectionModel>
        </SelectionModel>
        <BottomBar>
            <ext:PagingToolBar ID="PagingToolBar4" runat="server" PageSize="10" StoreID="Store1" />
        </BottomBar>
        <LoadMask ShowMask="true" />
    </ext:GridPanel>
    I want to assign each record in the grid to different purchasers all at once when click the assign btn, so I need to traverse Store1.

    Thanks to Geoffrey's help, I've already got the row count of Store1 using a extraParam.

    Now I can only get the Text of the comboBox in the selected row. Please see backend code below
            protected void BtnAssign_Click(object sender, AjaxEventArgs e)
            {
                Column col = GridPanel2.ColumnModel.Columns[6];
                int count = Int32.Parse(e.ExtraParams["CORowCount"]);
    
    
                for (int i = 0; i < count; i++)
                {
                    //Column col = GridPanel2.ColumnModel.Columns[6];//I think there might be something wrong with this line
                    Coolite.Ext.Web.ComboBoxBase comboBox = col.Editor.Editor as Coolite.Ext.Web.ComboBoxBase;
                    string s = comboBox.SelectedItem.Text;
                }
    
    
            }
    I think it should be the selected item in the comboBox of each Row, but in debug mode, I found that it was the selected item in the comboBox of the selected row, which means that value will never change.

    Guys, do you know where the problem is? Please help me. Thanks.
  2. #2

    RE: A problem about comboBox in a GridRow

    *Anybody know how to handle this?

    Still waiting...

Similar Threads

  1. [CLOSED] Gridrow select event
    By sisa in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 31, 2011, 5:46 AM
  2. Replies: 4
    Last Post: Oct 20, 2009, 6:43 PM
  3. [CLOSED] Pass value of gridrow to page in iframe
    By CSG in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 11, 2009, 4:34 PM
  4. Replies: 5
    Last Post: Jun 10, 2009, 5:13 AM
  5. Can't deselect GridRow with multiple selection
    By dbassett74 in forum 1.x Help
    Replies: 1
    Last Post: Jun 07, 2009, 3:07 PM

Posting Permissions