[CLOSED] Assigning ComboBox Value

Threaded View

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

    [CLOSED] Assigning ComboBox Value

    Hi
    ComboBox1.Value = "some value" works fine when values are hard-coded. When derived from a DataSource assigning the value appears to fail. Please see the following basic Northwind sample.

    protected void Page_Load(object sender, EventArgs e)
    {
            if (!X.IsAjaxRequest)
            {
                ComboBox1.Value = "5";
            }
    }
    <asp:SqlDataSource 
        ID="SqlDataSource1" 
        runat="server" 
        ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="
        SELECT 
            [EmployeeID], 
            [LastName]
        FROM [Employees]"
        />
    
    
    <ext:Store ID="Store1" runat="server" DataSourceID="SqlDataSource1">
        <Model>
            <ext:Model ID="Model1" runat="server" IDProperty="EmployeeID">
                <Fields>
                    <ext:ModelField Name="EmployeeID" />
                    <ext:ModelField Name="LastName" />
                </Fields>
            </ext:Model>
        </Model>
    </ext:Store>
    
    
    <ext:ComboBox 
        ID="ComboBox1" 
        runat="server" 
        StoreID="Store1" 
        DisplayField="LastName"
        ValueField="EmployeeID">
    </ext:ComboBox>
    Last edited by Daniil; Mar 11, 2012 at 4:44 PM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] Assigning and adding data in Text Field
    By Digital.Dynamics in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: May 24, 2012, 9:33 AM
  2. Replies: 4
    Last Post: Nov 30, 2011, 6:25 AM
  3. [CLOSED] Assigning store data from javascript not working
    By SymSure in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 05, 2011, 3:07 PM
  4. Replies: 11
    Last Post: Dec 14, 2010, 7:42 AM
  5. [CLOSED] Assigning multiple custom targets
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 07, 2010, 9:16 AM

Posting Permissions