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

Wincontrols: Combobox in Grid

5 Answers 200 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dimple
Top achievements
Rank 1
Dimple asked on 06 Aug 2007, 06:34 PM
Hi,

Is it possible to allow combobox in grid instead of textbox? I saw demo with spinner, calendar but couldn't find any example showing combobox inside grid.

Thanks,
Dimple

5 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 07 Aug 2007, 10:31 AM
Hello DKP,

Yes, it is possible to have a combobox editor in our grid, but this is demonstrated in the "Events" example. To achieve this, you should add a column of GridViewComboBoxColumn type to the Columns collection of the grid. Then you have to set its DataField property to the field of the data source that should be displayed. Also, you have to set its DataSource and eventually DisplayMember and ValueMember properties to fill the drop-down list of the combobox editor.

I hope this information helps. If you have any additional questions, please don't hesitate to write us.

All the best,
Georgi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Pooya
Top achievements
Rank 1
answered on 20 Nov 2012, 12:56 PM
HI
Is It Possible i creat class and i add this class to gridview and make gridview with combobox?
this is my code :
class Class1
    {
        public String Caption { get; set; }
         public GridViewComboBoxColumn _Comb;
         public GridViewComboBoxColumn Comb
         {
             get
             {
                 _Comb = new GridViewComboBoxColumn();
                 _Comb.DataSource = new string[] { "1", "2" };
                 return _Comb;
             }
         }
      
        public static List<Class1> GetClass()
        {
            List<Class1> List = new List<Class1>();
            Class1 c = new Class1();
            c.Caption = "hi";
            List.Add(c);
            return List;
        }
    }
0
Ivan Petrov
Telerik team
answered on 23 Nov 2012, 09:11 AM
Hi Pooya,

Thank you for writing.

I am afraid I do not understand your scenario completely. Can you please share what you want to achieve in more details (screen shots, sketches, code snippets) . This will allow me to define your case/problem and provide you with an adequate answer.

Looking forward to your reply.
 
Greetings,
Ivan Petrov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Pooya
Top achievements
Rank 1
answered on 26 Nov 2012, 05:38 AM
Hi Ivan
Thank you.
I have class that have a GridViewComboBoxColumn field
and i want create List Of it and Bind List to my DataSource Grid 
when i do it the grid show this field as text Box and can not show it as ComboBoxColumn

Plz Help Me
0
Ivan Petrov
Telerik team
answered on 29 Nov 2012, 06:48 AM
Hi Pooya,

Thank you for writing back.

Binding a RadGridView to a list of items means that you will be editing or showing (Read Only) the properties of each item of the list. If you have a combo box column field you will be editing this field which is not a very common case. If you want to edit a text field (or another type of field) with a combo box then you can achieve this in two ways:
1. You can add a Combo box column to the grid and set it's FieldName property to the property you want to edit.
2. You can change the editor used for editing a particular cell through the CellEditorRequired event.

I hope this will be useful. Should you have further questions, I would be glad to help.
 
Regards,
Ivan Petrov
the Telerik team
Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
Tags
GridView
Asked by
Dimple
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Pooya
Top achievements
Rank 1
Ivan Petrov
Telerik team
Share this question
or