I follow the example of DataGrid dynamic data support. But my data is a DataTable alread. How can I bind it to the "RadzenDataGrid". Since the columns.key in dictionary can't duplicated. But my data has a lots duplicated data which failed put them the the key.
I am try to using.
public class ItemData
{
public string key { get; set; }
public object value { get; set; }
}
@jjqin I convert my datatable to dictionaries with code like this:
var columns = new Dictionary<string, Type>();
var data = new List<IDictionary<string, object>>();
foreach (DataColumn column in result.Columns)
{
columns.Add(column.ColumnName, column.DataType);
}
foreach (DataRow row in result.Rows)
{
var item = new Dictionary<string, object>();
foreach (DataColumn column in result.Columns)
{
item.Add(column.ColumnName, row[column]);
}
data.Add(item);
}