Hello,
if i bind a DataTable to a RadGridView.ItemsSource and try to search with SearchPanel, i'm getting a System.ArgumentException error.
Column 'xy' does not belong to table xy.
Can you help me please? Thanks.
<
telerik:RadGridView
ItemsSource
=
"{Binding Table}"
ShowSearchPanel
=
"True"
/>
private
DataTable _table;
public
DataTable Table
{
get
{
return
_table; }
set
{
if
(Equals(value, _table))
return
;
_table = value;
OnPropertyChanged(nameof(Table));
}
}
public
ViewModel()
{
Table =
new
DataTable(
"Test"
);
Table.Columns.Add(
"Spalte 1"
);
Table.Columns.Add(
"Spalte 2"
);
Table.Columns.Add(
"Spalte 3"
);
for
(var i = 0; i < 50; i++)
{
var row = Table.NewRow();
row.ItemArray =
new
object
[] {
"Cell 1 "
+ i,
"Cell 2 "
+ i,
"Cell 3 "
+ i };
Table.Rows.Add(row);
}
}