Is there any way to adjust the height of the items displayed when a GridViewComboBoxColumn is opened? I'm not talking about the dropdownheight...I mean changing the height of each element inside the dropdown.
I'll be honest, I expected this column type to include a .ListElement property just like a RadDropDownList has but I've searched and cannot find a reference to this anywhere.
Any help you can provide would be appreciated.
4 Answers, 1 is accepted
After Frankensteining about 40 different pieces of code I came up with this:
Private Sub MCGrid_CellEditorInitialized(sender As Object, e As GridViewCellEventArgs) Handles MCGrid.CellEditorInitialized
Dim ddl As RadDropDownListEditor = TryCast(e.ActiveEditor, RadDropDownListEditor)
If ddl IsNot Nothing Then
Dim editorElement As RadDropDownListEditorElement = TryCast(ddl.EditorElement, RadDropDownListEditorElement)
editorElement.ListElement.ItemHeight = 25
RemoveHandler editorElement.VisualItemFormatting, AddressOf editorElement_VisualItemFormatting
AddHandler editorElement.VisualItemFormatting, AddressOf editorElement_VisualItemFormatting
End If
End Sub
You don't need the Visual Formatting - my code snippet includes that reference because my dropdown list also displays an image.
The CellEditorInitialized event is fired when the editor is initialized and visible. It is the appropriate place to introduce any customization to the editor. Adjusting the ItemHeight property of the ListElement is the correct way to increase/decrease the height. As you have already found out, it is possible to subscribe to the VisualItemFormatting event in order to customize the items in the drop down.
If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik
Thank you for replying so quickly, Dess!
I'm doing some seriously nasty things with your grid and so far it's holding up SO MUCH MORE than I expected!!! And knowing there's a team of experts ready, willing and capable of giving terrific replies makes me support your libraries that much more.
PLEASE SAY 'THANK YOU!' TO YOUR ENTIRE TEAM!
-Curtis
Thank you very much for the kind words. We are really glad to hear when our customers are satisfied with the product and the support service we provide.
If you have any additional questions, please let me know.
Regards,
Dess
Progress Telerik