Hi,
I am having trouble with the first value displayed in a dropdownlist. The column is bound to a datasource that contains all possible values in the forms load event. Under the cell editor initialized event I change the drop down list editor element's datasource to only show relevant values based on another columns value. This is all working fine with correct values being populated in the list. However if I select the first value in the drop down list it does not display. All the other values work as expected.
CellEditorInitialized event:
I am having trouble with the first value displayed in a dropdownlist. The column is bound to a datasource that contains all possible values in the forms load event. Under the cell editor initialized event I change the drop down list editor element's datasource to only show relevant values based on another columns value. This is all working fine with correct values being populated in the list. However if I select the first value in the drop down list it does not display. All the other values work as expected.
Load event:
Dim
ListDisplayColumn
As
GridViewComboBoxColumn = dgvReportingIndicators.Columns(
"ListSwitchDisplay"
)
ListDisplayColumn.DataSource =
Me
.TrafficLightIndicatorsTableAdapter.GetData
ListDisplayColumn.DisplayMember =
"DisplayName"
ListDisplayColumn.FieldName =
"ListSwitch"
ListDisplayColumn.ValueMember =
"ID"
CellEditorInitialized event:
If
e.Column.Name =
"ListSwitchDisplay"
Then
Dim
dropDownEditor = TryCast(dgvReportingIndicators.ActiveEditor, RadDropDownListEditor)
Dim
element = TryCast(dropDownEditor.EditorElement, RadDropDownListEditorElement)
Select
Case
e.Row.Cells(
"IndicatorTypeDisplay"
).Value
Case
"Count"
element.DataSource =
Me
.TrafficLightIndicatorsTableAdapter.GetNotApplicable
Case
"Traffic Light"
element.DataSource =
Me
.TrafficLightIndicatorsTableAdapter.GetTL
End
Select
element.ShowPopup()
End
If