I have a RadFilter with multiple RadFilterDropDownEditors with DropDownType RadComboBox. All of these I've set the DataSource in the ExpressionItemCreated Event.
Because of the size of the dataset for one of the combox boxes, I'm trying to use LoadOnDemand like so:
This works pretty well, but as soon as I click to add a new expression or load the filter from saved data, it no longer remembers the Selected Text value - it's blank. It remembers the SelectedValue, and the numeric value appears in the Filter Expression below the control, but I need it to display the text value as well.
Is there an event where I can get the selected value and set the Text field of the combo box?
Here's the markup for the filter if that helps
Because of the size of the dataset for one of the combox boxes, I'm trying to use LoadOnDemand like so:
protected
void
RadFilter1_ExpressionItemCreated(
object
sender, RadFilterExpressionItemCreatedEventArgs e)
{
var singleItem = e.Item
as
RadFilterSingleExpressionItem;
if
(singleItem !=
null
&& singleItem.IsSingleValue)
{
if
(singleItem.InputControl
is
RadComboBox)
{
var dropDownList = singleItem.InputControl
as
RadComboBox;
switch
(singleItem.FieldName)
{
case
"Security"
:
dropDownList.EnableLoadOnDemand =
true
;
dropDownList.ShowMoreResultsBox =
true
;
dropDownList.EnableVirtualScrolling =
true
;
dropDownList.WebServiceSettings.Method =
"GetSecurityNames"
;
dropDownList.WebServiceSettings.Path =
"DataSetPopup.aspx"
;
break
;
}
}
}
}
This works pretty well, but as soon as I click to add a new expression or load the filter from saved data, it no longer remembers the Selected Text value - it's blank. It remembers the SelectedValue, and the numeric value appears in the Filter Expression below the control, but I need it to display the text value as well.
Is there an event where I can get the selected value and set the Text field of the combo box?
Here's the markup for the filter if that helps
<
rad:RadFilter
runat
=
"server"
ID
=
"RadFilter1"
OnFieldEditorCreating
=
"RadFilter1_FieldEditorCreating"
OnApplyExpressions
=
"RadFilter1_ApplyExpressions"
OnExpressionItemCreated
=
"RadFilter1_ExpressionItemCreated"
ExpressionPreviewPosition
=
"Bottom"
ShowApplyButton
=
"false"
AllowFilterOnBlur
=
"true"
SettingsFormatter
=
"BinaryFormatter"
>
<
FieldEditors
>
<
rad:RadFilterDropDownEditor
FieldName
=
"Currency"
DataTextField
=
"IsoCurrencyCode"
DataValueField
=
"CurrencyId"
DropDownType
=
"RadComboBox"
/>
<
rad:RadFilterDropDownEditor
FieldName
=
"Country"
DataTextField
=
"CountryDesc"
DataValueField
=
"CountryId"
DropDownType
=
"RadComboBox"
/>
<
rad:RadFilterDropDownEditor
FieldName
=
"Region"
DataTextField
=
"RegionDesc"
DataValueField
=
"RegionId"
DropDownType
=
"RadComboBox"
/>
<
rad:RadFilterDropDownEditor
FieldName
=
"Security"
DataTextField
=
"Security"
DataValueField
=
"SecurityId"
DropDownType
=
"RadComboBox"
/>
</
FieldEditors
>
</
rad:RadFilter
>