5 Answers, 1 is accepted
0
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
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;
}
}
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
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
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
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
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
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
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