How to: Bind ASPxComboBox to DateTime data
The ASPxComboBox.ValueType property determines the type of the ASPxComboBox value. This property cannot have the System.DateTime value: the control does not support this value type. You should use the ASPxDateEdit component to display dates. However, there are cases when it is not suitable. For example, if a user needs to select a combo box value from multiple predefined dates, you can use one of the following techniques:
- Set the ASPxComboBox.ValueType property value to System.Int32 and use the DateTime.Ticks property of DateTime objects as values for the combo box items.
- Set the ASPxComboBox.ValueType property value to System.String and use string representations of dates instead of DateTime objects.
If the combo box is used inside the ASPxGridView (as an editor inside a template or as a GridViewDataComboBoxColumn column’s editor), use unbound columns and apply one of the above approaches.
See Also