This is a migrated thread and some comments may be shown as answers.

Compose SELECT ..WHERE from SelectedItems

2 Answers 53 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ciupaz
Top achievements
Rank 2
Veteran
Ciupaz asked on 12 Jul 2020, 04:02 PM

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 Answers, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 13 Jul 2020, 02:17 PM

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

0
Ciupaz
Top achievements
Rank 2
Veteran
answered on 13 Jul 2020, 02:25 PM

Ok Attila, thank you. 

I'll try in this way. 

Luis

Tags
ComboBox
Asked by
Ciupaz
Top achievements
Rank 2
Veteran
Answers by
Attila Antal
Telerik team
Ciupaz
Top achievements
Rank 2
Veteran
Share this question
or