This is a migrated thread and some comments may be shown as answers.

GridViewComboBoxColumn dropdown item Height

4 Answers 47 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Curtis
Top achievements
Rank 1
Veteran
Curtis asked on 01 Jun 2018, 11:07 PM

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

Sort by
0
Curtis
Top achievements
Rank 1
Veteran
answered on 01 Jun 2018, 11:15 PM

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.

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Jun 2018, 08:06 AM
Hello, Curtis,  

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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Curtis
Top achievements
Rank 1
Veteran
answered on 05 Jun 2018, 04:24 AM

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

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Jun 2018, 09:37 AM
Hello, 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
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Curtis
Top achievements
Rank 1
Veteran
Answers by
Curtis
Top achievements
Rank 1
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or