Hi,
I have problem with GridViewMultiComboBoxColumn. I using the latest version of telerik package (Q1 2012).
I have two objects:
When i set GridViewMultiComboBoxColumn for "Client" property then I have exception: Converter can't convert.
If I dont't set ValuMember property, then is no exception, byt choose object in grid don't work.
What am I doing wrong?
Best Regards
I have problem with GridViewMultiComboBoxColumn. I using the latest version of telerik package (Q1 2012).
I have two objects:
public class Offer
{
public Guid Id { get; set; }
public string OfferNo { get; set; }
public Customer Client { get; set; }
public DateTime? DateFrom { get; set; }
public DateTime? DateTo { get; set; }
}
public class Customer
{
public Guid CustomerId { get; set; }
public string Name { get; set; }
public string ShortName { get; set; }
}
When i set GridViewMultiComboBoxColumn for "Client" property then I have exception: Converter can't convert.
If I dont't set ValuMember property, then is no exception, byt choose object in grid don't work.
public Form1()
{
InitializeComponent();
custs = GridData.GetCustomers(5);
IList offers = GridData.GetGridData(custs);
radGridView1.DataSource = offers;
SetColumns();
}
private void SetColumns()
{
radGridView1.Columns.Clear();
GridViewDataColumn column = null;
for (int i = 0; i < 4; i++)
{
switch (i)
{
case 0:
column = new GridViewTextBoxColumn("Offer no");
break;
case 2:
column = new GridViewDateTimeColumn("Date from");
break;
case 3:
column = new GridViewDateTimeColumn("Date to");
break;
case 1:
column = new GridViewMultiComboBoxColumn("Client");
((GridViewMultiComboBoxColumn)column).FieldName = "Client";
((GridViewMultiComboBoxColumn)column).DataSource = custs;
((GridViewMultiComboBoxColumn)column).DisplayMember = "Name";
((GridViewMultiComboBoxColumn)column).ValueMember = "CustomerId";
break;
}
column.Width = 150;
column.IsVisible = true;
column.ReadOnly = false;
radGridView1.Columns.Add(column);
}
}
What am I doing wrong?
Best Regards