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

GridViewComboBoxColumn

2 Answers 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Matthias
Top achievements
Rank 1
Matthias asked on 16 Dec 2016, 01:23 PM

Hello

I have two questions about the GridViewComboBoxColumn:

 

1. When I start editing a cell form a GridViewComboBoxColumn it always clears the currently displayed value. How can I disable that?

2. How can I change the item height of the drop down list? Is there something like the ItemHeight property of the ListElement of a RadDropDownList?

 

Best regards

Matthias Reiseder

2 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Dec 2016, 02:21 PM
Hello Matthias,

Thank you for writing.  

Please refer to the following help article demonstrating how to setup the GridViewComboBoxColumn:  http://docs.telerik.com/devtools/winforms/gridview/columns/column-types/gridviewcomboboxcolumn

It is necessary to specify the DisplayMember and ValueMember properties. The cells values must be valid according to the applied ValueMember and the available records in the DataSource. Thus, the editor will be initialized with the cell's value.

As to the second question, in order to increase the item height in the popup, handle the CellEditorInitialized as below:
private void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDropDownListEditor ddl = e.ActiveEditor as RadDropDownListEditor;
    if (ddl!=null)
    {
        RadDropDownListEditorElement el = ddl.EditorElement as RadDropDownListEditorElement;
        el.ItemHeight = 40;
    }
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Matthias
Top achievements
Rank 1
answered on 19 Dec 2016, 08:02 AM

Hello Dess,

that answered my questions and I got it to work. Thank you.

Best regards
Matthias Reiseder

Tags
GridView
Asked by
Matthias
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Matthias
Top achievements
Rank 1
Share this question
or