I am using a Filter control that is never bound to a grid or list view. I have a set of fields that are passed into my user control, and I iterate over those fields to build the FieldEditor controls that I need in my Filter control. This works well for all the standard FieldEditor types, (ie. boolean, numeric, text) However, I am having trouble populating the choices for editors of type RadFilterCustomEditors.RadFilterDropDownEditor I am using the following code called from my user controls pre render event.
obviously this is incomplete and doesn't work. I have tried creating a FilterChoice object with a display and value property and binding a list of those to an objectdatasource, but ran into issues there with strings being in the wrong format, and that really isn't the best implementation anyway, so I have abandoned it for the time being.
So my question is in a nutshell, how do I build a list of choices, and bind it to a
Dim
choices
As
Dictionary(Of
String
,
String
) =
New
Dictionary(Of
String
,
String
)()
choices.Add(
"Yes"
,
"Yes"
)
choices.Add(
"No"
,
"No"
)
Dim
field
As
RadFilterCustomEditors.RadFilterDropDownEditor =
New
RadFilterCustomEditors.RadFilterDropDownEditor()
field.DataSourceID = "????" 'What would go here?
field.DataValueField =
"Key"
field.DataTextField =
"Value"
QuestionFilter.FieldEditors.Add(field)
field.FieldName = question.Id
field.DisplayName = question.Description
obviously this is incomplete and doesn't work. I have tried creating a FilterChoice object with a display and value property and binding a list of those to an objectdatasource, but ran into issues there with strings being in the wrong format, and that really isn't the best implementation anyway, so I have abandoned it for the time being.
So my question is in a nutshell, how do I build a list of choices, and bind it to a
RadFilterCustomEditors.RadFilterDropDownEditor
at run time without being tied to a grid?