Jun 07, 2010, 12:43 PM
[CLOSED] GridPanel with Remote Filtering, Sorting and Paging (datatable)
Hi,
Trying to use this example (https://examples1.ext.net/#/GridPane...ilters_Remote/). But instead of the fixed list in the example I trying to use datatables.
I've tried this:
As a substitute for this:
But that's not working.
SO..how do can I convert a simple datatable to a list I can use with your code.
Regards,
Martin
Trying to use this example (https://examples1.ext.net/#/GridPane...ilters_Remote/). But instead of the fixed list in the example I trying to use datatables.
I've tried this:
public List<object> DataTableToList(ref DataTable dt)
{
List<object> list = new List<object>();
foreach (System.Data.DataRow row in dt.Rows)
{
Dictionary<string, object> rowDic = new Dictionary<string, object>();
foreach (System.Data.DataColumn column in row.Table.Columns)
{
rowDic.Add(column.ColumnName, row[column]);
}
list.Add(rowDic);
}
return list;
}
As a substitute for this:
public static List<object> Data
{
get
{
var goods = new List<object>
{
new
{
Id = 1,
Price = 71.72,
Company = "3m Co",
Date = new DateTime(2007, 9, 1),
Size = "large",
Visible = true
},
...
};
return goods;
}
}
But that's not working.
SO..how do can I convert a simple datatable to a list I can use with your code.
Regards,
Martin