Not retrieving data from RadGridView in silverlight

2 posts, 0 answers
  1. Roger
    Roger avatar
    5 posts
    Member since:
    Jun 2014

    Posted 13 Jun 2014 Link to this post

    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++)
    xxx = 0;
    Firstcontrol.RadGridView1.ItemsSource = statisticCollection;


    //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" >

  2. Nick
    Nick avatar
    593 posts

    Posted 17 Jun 2014 Link to this post

    Hello Roger,

    The problem is that the columns are still not loaded. You can try invoking the loop for the columns in a Dispatcher call.

    Hope this helps. 

    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
  3. DevCraft R3 2016 release webinar banner
Back to Top