Compose SELECT ..WHERE from SelectedItems

3 posts, 0 answers
  1. Ciupaz
    Ciupaz avatar
    47 posts
    Member since:
    Jun 2020

    Posted 12 Jul Link to this post

    Hello,
    I have 2 RadComboBox.
    The first one select one or more cities:

    <telerik:RadComboBox ID="cmbCities"
                    EmptyMessage="Cities" runat="server"
                    MarkFirstMatch="true" Width="100%"
                    CheckBoxes="true" EnableCheckAllItemsCheckBox = "true"
                    DataTextField="CityName" AutoPostBack ="true"
                    DataValueField="CityCode" 
                    OnSelectedIndexChanged="cmbCities_SelectedIndexChanged">
    </telerik:RadComboBox>

     

    and the second one should is bases on the selected items of the first one, 
    and should shows the products available in the selected cities. 

     

    <telerik:RadComboBox ID="cmbProducts"
                    EmptyMessage="Products" runat="server"
                    MarkFirstMatch="true" Width="100%"
                    CheckBoxes="true" EnableCheckAllItemsCheckBox = "true"
                    DataTextField="ProductName" AutoPostBack ="true"
                    DataValueField="ProductCode" 
                    OnSelectedIndexChanged="cmbProduct_SelectedIndexChanged">
    </telerik:RadComboBox>

     

    My problem is that I don't know how to create the query (SELECT) based on the first combobox selection,
    something like:

    SELECT ProductName, ProductCode FROM Products WHERE CityCode IN (........selectedItems from 1st RadComboBox....)

    Can anyone help me?

    Thanks a lot. 


    Luis

     

     

     

     

     

     

  2. Attila Antal
    Admin
    Attila Antal avatar
    571 posts

    Posted 13 Jul Link to this post

    Hi Ciupaz,

    I have sent you a response with an example in the Support ticket as well as in the other Forum thread you asked this question, see Filter RadComboBox from another combobox

    Kind regards,
    Attila Antal
    Progress Telerik

  3. Ciupaz
    Ciupaz avatar
    47 posts
    Member since:
    Jun 2020

    Posted 13 Jul in reply to Attila Antal Link to this post

    Ok Attila, thank you. 

    I'll try in this way. 

    Luis

Back to Top