Hi All,
I have 2 comboboxes on page both i have bind load on demand, both are working well but i want to get selected value of first combobox on second combobox OnItemsRequested Event but when second combobox event OnItemsRequested fires the selected value of first combobox is null my code is follws
I have 2 comboboxes on page both i have bind load on demand, both are working well but i want to get selected value of first combobox on second combobox OnItemsRequested Event but when second combobox event OnItemsRequested fires the selected value of first combobox is null my code is follws
<
telerik:RadComboBox
ID
=
"rcbCategory"
runat
=
"server"
EmptyMessage
=
"Select Category"
OnItemsRequested
=
"rcbCategory_OnItemsRequested"
EnableLoadOnDemand
=
"true"
EnableViewState
=
"true"
>
</
telerik:RadComboBox
>
<
telerik:RadComboBox
ID
=
"rcbSubCategory"
runat
=
"server"
OnItemsRequested
=
"rcbSubCategory_OnItemsRequested"
EnableLoadOnDemand
=
"true"
EmptyMessage
=
"Select Sub-Category"
>
</
telerik:RadComboBox
>
C#
protected void rcbCategory_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
rcbCategory.DataSource = Category.GetAll();
rcbCategory.DataValueField = "ID";
rcbCategory.DataTextField = "CategoryName";
rcbCategory.DataBind();
}
protected void rcbSubCategory_OnItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
rcbSubCategory.DataSource = SubCategory.GetAll(rcbCategory.SelectedValue);
rcbSubCategory.DataValueField = "ID";
rcbSubCategory.DataTextField = "CategoryName";
rcbSubCategory.DataBind();
}