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

Adding combobox in first row of decimal column

3 Answers 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Borislav
Top achievements
Rank 1
Borislav asked on 25 Sep 2017, 05:45 PM

Hello,

I have a requirement to display grid view of decimal value columns with the exception that I need to show comboboxes in the first row of the grid view. Comboboxes will have three non-editable values. How to achieve this?

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 26 Sep 2017, 08:03 AM
Borislav,

The following article shows how you can achieve this: Change the Active Editor Depending on the Cell Value Type.

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
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
Borislav
Top achievements
Rank 1
answered on 02 Oct 2017, 08:18 AM

In the article you sent there is no example of how to allow user to select one out of some predefined values from dropdown. In my case, these values should be shown as text values but in the background they are represented by integers 0, 1, and 2 (an enum)

 How can I achieve this? 

0
Dimitar
Telerik team
answered on 02 Oct 2017, 10:41 AM
Hi Borislav,

Here is how you can add DropDownListEditor and set its data source:
private void RadGridView1_EditorRequired(object sender, Telerik.WinControls.UI.EditorRequiredEventArgs e)
{
    if (radGridView1.CurrentColumn.Name == "DeciamlColumn")
    {
        var editor = new RadDropDownListEditor();
        var element = editor.EditorElement as RadDropDownListEditorElement;
        element.DataSource = GetTable1();
        element.DisplayMember = "Text";
        element.ValueMember = "Value";
        e.Editor = editor;
    }
}

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
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.
Tags
GridView
Asked by
Borislav
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Borislav
Top achievements
Rank 1
Share this question
or