Hi Carly,
I would not recommend you to use CMSQueryDataSource as source for dropdownlist. It is suitable for BasicRepeater or BasicDataList but not for dropdownlist. You may use the datasource gained by ExecuteQuery – e.g.
public static DataSet CMS.SettingsProvider.SqlHelperClass.ExecuteQuery(
string queryName,
Object[,] parameters,
string where,
string orderBy
)
You may add the condition to e.g. Paga_Load method:
if (!IsPostBack)
{
DataSet ds = new DataSet();
country.Items.Clear();
ds = CMS.SettingsProvider.SqlHelperClass.ExecuteQuery(<query name>, null, null, null);
country.DataSource = ds;
country.DataTextField = <value>;
country.DataValueField = <value>;
country.DataBind();
}
and add code similar to this one in "selected index changed" event:
DataSet ds = new DataSet();
country.Items.Clear();
ds = CMS.SettingsProvider.SqlHelperClass.ExecuteQuery(<query name>, null, mainwhere, null);
country.DataSource = ds;
country.DataTextField = <value>;
country.DataValueField = <value>;
country.DataBind();
Best regards,
Helena Grulichova