Hi,
I am trying to set a DataTable as ItemsSource for a RadGridView and get the following exception:
at System.Linq.Enumerable.<CastIterator>d__aa`1.System.Collections.IEnumerator.Reset()
at Telerik.Windows.Data.EnumerableExtensions.TryGetFirstElementType(IEnumerable source, Type& firstElementType) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\EnumerableExtensions.cs:line 54
I do the following:
Anybody has some suggestions what I am doing wrong here?
I am trying to set a DataTable as ItemsSource for a RadGridView and get the following exception:
at System.Linq.Enumerable.<CastIterator>d__aa`1.System.Collections.IEnumerator.Reset()
at Telerik.Windows.Data.EnumerableExtensions.TryGetFirstElementType(IEnumerable source, Type& firstElementType) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\EnumerableExtensions.cs:line 54
I do the following:
DataTable
dataTable = new DataTable();
string[] values = dataValue.Value.Split(',');
for (int i = 0; i < values.Length; i++)
{
dataTable.Columns.Add(i.ToString(),
typeof(string));
}
dataTable.Rows.Add(values);
this.radGridView1.AutoGenerateColumns = true;
this.radGridView1.ItemsSource = dataTable;
Anybody has some suggestions what I am doing wrong here?