[CLOSED] ComboBox has no SelectedIndex property

  1. #1

    [CLOSED] ComboBox has no SelectedIndex property

    Dears,

    I have the following ComboBox definitions:

    <ext:ComboBox Flex="1" ID="ddlAccountType" runat="server"  LabelAlign="Left" FieldLabel="Account Type">
    		<Items>
    			<ext:ListItem  Text="Customer" Value="Customer"></ext:ListItem>
    			<ext:ListItem  Text="Supplier" Value="Supplier"></ext:ListItem>
    		</Items>                                                  
    </ext:ComboBox>
    I want to test, whether the ComboBox has selection or not:

     If ddlAccountType.SelectedIndex > -1 Then
    
     End If
    This is the error I get:

    'SelectedIndex' is not a member of 'Ext.Net.ComboBox'.

    What I should do?!

    Regards,
    Alaswad
    Last edited by fabricio.murta; Feb 08, 2016 at 6:35 PM.
  2. #2
    Hello Alaswad!

    This falls back to the "code behind don't know what you clicked/changed on client side" matter. Let me know if you want to know more about this.

    To have code behind know what the user selected on a combo box (or any other component) you have to explicitly pass the value from the client call (or direct method). If it was not this way, every little code behind call would mean the user passing up all the page's status, which would be extremely cumbersome in the vast majority of cases.

    Here's an example showing how to pass arguments to directMethods: DirectMethod Overview (third item).

    The example above actually shows you how to pass the selected value from a combo box, so I believe this is all you need. Let me know otherwise.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. [CLOSED] ComboBox SelectedIndex
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 30, 2012, 9:33 AM
  2. Replies: 11
    Last Post: Feb 06, 2012, 2:56 PM
  3. ComboBox and SelectedIndex
    By glenh in forum 1.x Help
    Replies: 3
    Last Post: Oct 18, 2010, 7:57 AM
  4. [CLOSED] Get ComboBox SelectedIndex in C#
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 18, 2008, 7:27 AM
  5. Replies: 2
    Last Post: Oct 06, 2008, 11:27 AM

Posting Permissions