I can use the sample code to create a drop down for the possible values of a field (i.e. to the right hand side of the greater than or equal to or whatever)
However, I want to put a combo box in the place of the field selector itself (the left hand side of the greater than / equal to)
I can successfully create the combo box, but then it appears in the wrong place (the right hand side). See the code that does this below.
So I tried putting it at position 0.. In InitializeEditor, instead of this line:
container.Controls.Add(_combo);
I had:
container.Controls.AddAt(0);
This puts it in the correct place, but then I cannot work out how to add the functionality that ensures that when the user clicks on
a particular entry, the text box appears to the right of the greater than/ equal to section?
I think I have to capture the onselected event from the combo box and then create the appropriate textbox control right?
PLEASE HELP!
RadFilterDropDownEditor dropDownFieldEditor = new RadFilterDropDownEditor();
RadFilter1.FieldEditors.Add(dropDownFieldEditor);
DataTable dt = MakeTable();
//create the list of fields to select on
foreach (FilterFieldDTO dtoField in filterOptionList)
{
DataRow row;
row = dt.NewRow();
row["FieldName"] = dtoField.FieldName;
string strFieldName;
if (row["FieldName"].ToString().LastIndexOf(".") > -1)
{
strFieldName = row["FieldName"].ToString().Substring(row["FieldName"].ToString().LastIndexOf(".") + 1);
}
else
{
strFieldName = row["FieldName"].ToString();
}
row["FieldName"] = strFieldName;
row["DataValueField"] = strFieldName;
row["DataTextField"] = strFieldName;
dt.Rows.Add(row);
}
dropDownFieldEditor.DataTextField = "DataTextField";
dropDownFieldEditor.DataValueField = "DataValueField";
dropDownFieldEditor.FieldName = "FieldName";
dropDownFieldEditor.DataSource = dt;