Hello Chandra,
Thank you for writing.
If I understand correctly you are binding the grid to the A data source and you have two other sources for the combo columns. However the values are not synchronized when the grid is loaded, is this correct?
In this case, you should make sure that the
Field and the
ValueMemer have the same data type. Here is a complete example for this:
public
partial
class
RadForm1 : Telerik.WinControls.UI.RadForm
{
public
RadForm1()
{
InitializeComponent();
BindingList<Product> data =
new
BindingList<Product>();
for
(
int
i = 0; i < 10; i++)
{
data.Add(
new
Product() { CategoryId = i, ProductName =
"Product"
+ i });
}
radGridView1.AutoGenerateColumns =
false
;
radGridView1.DataSource = data;
BindingList<Category> categories =
new
BindingList<Category>();
for
(
int
i = 0; i < 10; i++)
{
categories.Add(
new
Category() { CategoryName =
"Category "
+ i, Id = i });
}
GridViewComboBoxColumn configColumn =
new
GridViewComboBoxColumn();
radGridView1.Columns.Add(configColumn);
configColumn.HeaderText =
"Configuration"
;
configColumn.DataSource = categories;
configColumn.FieldName =
"CategoryId"
;
configColumn.ValueMember =
"Id"
;
configColumn.DisplayMember =
"CategoryName"
;
}
}
class
Product
{
public
string
ProductName {
get
;
set
; }
public
int
CategoryId {
get
;
set
; }
}
class
Category
{
public
int
Id {
get
;
set
; }
public
string
CategoryName {
get
;
set
; }
}
I hope this will be useful.
Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this
blog post and share your thoughts.