Hi,
I found some samples about RadFilterDropDownEditor like:
But I faced 2 problems.
1-When I try to set its DataType to System.Int32, I receive "Input string was not in a correct format." error. But when I set it to System.String it works. (the result is = '1' -within single quotas- as expected as it is set to be string). I have checked DataTextField and DataValueField properties and they are referencing to proper fields and datatypes.
2-When I set its value from combobox and add another condition/expression it looses it value and select first value of the combobox.
Any thoughts?
Thanks in advance.
I found some samples about RadFilterDropDownEditor like:
public
class
RadFilterDropDownEditor : RadFilterDataFieldEditor
{
protected
override
void
CopySettings(RadFilterDataFieldEditor baseEditor)
{
base
.CopySettings(baseEditor);
var editor = baseEditor
as
RadFilterDropDownEditor;
if
(editor !=
null
)
{
DataSourceID = editor.DataSourceID;
DataTextField = editor.DataTextField;
DataValueField = editor.DataValueField;
}
}
public
override
System.Collections.ArrayList ExtractValues()
{
ArrayList list =
new
ArrayList();
list.Add(_combo.SelectedValue);
return
list;
}
public
override
void
InitializeEditor(System.Web.UI.Control container)
{
_combo =
new
RadComboBox();
_combo.DataTextField = DataTextField;
_combo.DataValueField = DataValueField;
_combo.DataSourceID = DataSourceID;
container.Controls.Add(_combo);
}
public
override
void
SetEditorValues(System.Collections.ArrayList values)
{
if
(values !=
null
&& values.Count > 0)
{
if
(values[0] ==
null
)
return
;
var item = _combo.FindItemByValue(values[0].ToString());
if
(item !=
null
)
item.Selected =
true
;
}
}
public
string
DataTextField
{
get
{
return
(
string
)ViewState[
"DataTextField"
] ??
string
.Empty;
}
set
{
ViewState[
"DataTextField"
] = value;
}
}
public
string
DataValueField
{
get
{
return
(
string
)ViewState[
"DataValueField"
] ??
string
.Empty;
}
set
{
ViewState[
"DataValueField"
] = value;
}
}
public
string
DataSourceID
{
get
{
return
(
string
)ViewState[
"DataSourceID"
] ??
string
.Empty;
}
set
{
ViewState[
"DataSourceID"
] = value;
}
}
private
RadComboBox _combo;
}
But I faced 2 problems.
1-When I try to set its DataType to System.Int32, I receive "Input string was not in a correct format." error. But when I set it to System.String it works. (the result is = '1' -within single quotas- as expected as it is set to be string). I have checked DataTextField and DataValueField properties and they are referencing to proper fields and datatypes.
2-When I set its value from combobox and add another condition/expression it looses it value and select first value of the combobox.
Any thoughts?
Thanks in advance.