How to maintain viewstate for combobox after page postbacks?

  1. #1

    How to maintain viewstate for combobox after page postbacks?


    After selecting a list item in cmbUnitsOfMeasurement combobox , If an ext button is clicked(Autopostback="true") the selected ValueField is shown instead of DisplayField .


    Html Source

    <ext:Store runat="server" ID="stUOM" OnRefreshData="stUOM_RefreshData">
            <ext:PageProxy />
                    <ext:RecordField Name="UomId" />
                    <ext:RecordField Name="Description" />
            <ext:Parameter Name="start" Value="0" Mode="Raw" />
            <ext:Parameter Name="limit" Value="15" Mode="Raw" />
    <ext:CompositeField ID="CompositeField1" runat="server" Width="250">
            <ext:ComboBox ID="cmbUnitsOfMeasurement" Width="230" runat="server" StoreID="stUOM" TypeAhead="false"
                FieldClass="Input-small"  MinChars="1" HideTrigger="true"
                DisplayField="Description" ValueField="UomId" ListClass="cb-list"
                MaxLength="50" LazyInit="false" ListWidth="300" PageSize="25">
                    <AfterRender Handler="this.pageTb.refresh.hide();" />
            <ext:Label ID="Label4" runat="server" CtCls="ColorRed"  Text="*"/>
    code behind

    protected void stUOM_RefreshData(object sender, StoreRefreshDataEventArgs e)
                int count = 1;
                List<UnitsOfMeasurement> listItem = SearchUOM(out count);
                (stUOM.Proxy[0] as PageProxy).Total = count;
                cmbUnitsOfMeasurement.GetStore().DataSource = listItem;
    Last edited by Daniil; Jul 14, 2011 at 11:45 PM. Reason: Please use [CODE] tags

Similar Threads

  1. How to maintain page index after postback.
    By itskvini in forum 1.x Help
    Replies: 3
    Last Post: Jul 05, 2012, 1:27 PM
  2. Replies: 0
    Last Post: Mar 19, 2012, 3:08 PM
  3. Replies: 2
    Last Post: Feb 23, 2012, 10:09 AM
  4. Why the ViewState of page not work?
    By cnet2001 in forum 1.x Help
    Replies: 1
    Last Post: Dec 17, 2010, 3:23 AM
  5. [CLOSED] [1.0] Grid reload and maintain page index
    By edigital in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 23, 2010, 5:41 PM

Posting Permissions