Adding combobox in first row of decimal column

4 posts, 0 answers
  1. Borislav
    Borislav avatar
    18 posts
    Member since:
    Nov 2016

    Posted 25 Sep Link to this post

    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?

  2. Dimitar
    Admin
    Dimitar avatar
    1877 posts

    Posted 26 Sep Link to this post

    Hi 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.
  3. Borislav
    Borislav avatar
    18 posts
    Member since:
    Nov 2016

    Posted 02 Oct in reply to Dimitar Link to this post

    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? 

  4. Dimitar
    Admin
    Dimitar avatar
    1877 posts

    Posted 02 Oct Link to this post

    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.
Back to Top