Hi
I have a column with multiple data types. I'm using the EditorRequired event to set the editor as a RadDateTimeEditor or RadDropDownListEditor using the code below. This mostly works but I have two problems.
1. With the country dropdown, I set dropDownStyle to DropDown. The editor allows me to type in any value but if the value is not one of the items in the list, as soon as I exit the cell the value disappears.
2. With the RadDateTimeEditor, I set the customFormat to "d" but when I select a value and exit the cell, it's showing the time as well as the date. How do I get it to show date only?
Private maritalStatuses() As String = {"Married", "In a De Facto Relationship", "Interdependent Relationship", "Engaged", "Separated", "Divorced", "Widowed", "Never Married"}
Private Countries() as String = {"", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola"}
Private Sub dgv_EditorRequired(sender As Object, e As EditorRequiredEventArgs) Handles dgv.EditorRequired
If dgv.CurrentColumn.Name = "ImportValue" Then
Select Case dgv.CurrentRow.Cells("EditorType").Value
Case radEditorType.DatePicker
Dim editor As RadDateTimeEditor = New RadDateTimeEditor
editor.CustomFormat = "d"
e.Editor = editor
Case radEditorType.CountryDropDown
Dim editor As New RadDropDownListEditor
editor.DropDownStyle = RadDropDownStyle.DropDown
DirectCast(editor.EditorElement, RadDropDownListEditorElement).DataSource = Countries
DirectCast(editor.EditorElement, RadDropDownListEditorElement).AutoCompleteMode = AutoCompleteMode.SuggestAppend
e.Editor = editor
Case radEditorType.MaritalStatusDropDown
Dim editor As New RadDropDownListEditor
DirectCast(editor.EditorElement, RadDropDownListEditorElement).DataSource = maritalStatuses
editor.DropDownStyle = RadDropDownStyle.DropDownList
e.Editor = editor
End Select
End If
End Sub