I have create a dynamic RadGridView and I load the data in the itemsource and add the RadGridView to a stackpanel.
I can see the data and sort it on the grid.
But when i use
foreach (GridViewColumn column in Firstcontrol.RadGridView1.Columns)
I only get the column name and not the data below the column.
Am I missing a binding somewhere?
This is the code where I create the collection and send it to itemsource.
int xxx = 0;
for (int j = 0; j < Rownum; j++) // Load Rows
{
var row = new ObservableCollection<dynamic>();
for (int ii = 0; ii < Colnum; ii++)
{
row.Add(statisticViewModelObect.StatisticCollection[TbCount].Rows.ElementAt(j).GetValue(xxx));
xxx++;
}
statisticCollection.Add(row);
xxx = 0;
}
Firstcontrol.RadGridView1.ItemsSource = statisticCollection;
StackPanel1.Children.Add(Firstcontrol);
//Rigth here is where I try to read the data that has been created on the grid.
foreach (GridViewColumn column in Firstcontrol.RadGridView1.Columns)
This is my xaml.--------------------------
<telerik:RadGridView x:Name="RadGridView1" HorizontalAlignment="Stretch"
ItemsSource="{Binding statisticCollection ,Mode=TwoWay}"
AutoGenerateColumns="False" ShowGroupPanel="False" Height="250"
VerticalAlignment="Top" IsReadOnly="True" CanUserSortColumns ="true" >
</telerik:RadGridView>
I can see the data and sort it on the grid.
But when i use
foreach (GridViewColumn column in Firstcontrol.RadGridView1.Columns)
I only get the column name and not the data below the column.
Am I missing a binding somewhere?
This is the code where I create the collection and send it to itemsource.
int xxx = 0;
for (int j = 0; j < Rownum; j++) // Load Rows
{
var row = new ObservableCollection<dynamic>();
for (int ii = 0; ii < Colnum; ii++)
{
row.Add(statisticViewModelObect.StatisticCollection[TbCount].Rows.ElementAt(j).GetValue(xxx));
xxx++;
}
statisticCollection.Add(row);
xxx = 0;
}
Firstcontrol.RadGridView1.ItemsSource = statisticCollection;
StackPanel1.Children.Add(Firstcontrol);
//Rigth here is where I try to read the data that has been created on the grid.
foreach (GridViewColumn column in Firstcontrol.RadGridView1.Columns)
This is my xaml.--------------------------
<telerik:RadGridView x:Name="RadGridView1" HorizontalAlignment="Stretch"
ItemsSource="{Binding statisticCollection ,Mode=TwoWay}"
AutoGenerateColumns="False" ShowGroupPanel="False" Height="250"
VerticalAlignment="Top" IsReadOnly="True" CanUserSortColumns ="true" >
</telerik:RadGridView>