DataTable issues

5 posts, 0 answers
  1. Michael Evans
    Michael Evans avatar
    31 posts
    Member since:
    Mar 2010

    Posted 27 Feb 2013 Link to this post

    I'm using Vladimir Enchev's DataTable in our RadGridView to display data. It was working great with an older version of the Silverlight controls. However we just upgraded to the latest version and I'm having some trouble with sorting, filtering, and paging. It seems like if I refresh the RadDataPager's data source in the _Sorting or _Filtering event then it will sort and filter correctly, but paging does not seem to work at all. And I'd rather not have to continually be setting and unsetting the RadDataPager's source. Anyone have any similar issues? It might be difficult for to provide a sample application because it's so complex.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 28 Feb 2013 Link to this post

    Hi,

     The recommended approach for dynamic data in Silverlight now is DynamicObject. I've posted more info about this almost two years ago. Nevertheless I've tried the latest release (Q1 2013) with my old project from the blog post however everything worked as expected (attached). 

    All the best,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Michael Evans
    Michael Evans avatar
    31 posts
    Member since:
    Mar 2010

    Posted 28 Feb 2013 Link to this post

    Hey Vlad,

    I may be closer to solving the issue. What I found is, the data behind the grid is changing, but the CellTemplates are not updating so it just looks like the data hasn't changed. I discovered this because I had used the RadDataPager to go to another page of data, then clicked the Edit button on the cell, and another record's data came up.

    This also jives with the weird behavior I was seeing before - when I would do a filter for a specific record, the grid would change to only show one row, but it would be the wrong row - it would still show the first row. But again, when I do an edit, it seems to be operating on the correct row.

    Any idea why the CellTemplate would not refresh what is being shown when the data set is changed, via paging, sorting, filtering, etc.?
  4. Michael Evans
    Michael Evans avatar
    31 posts
    Member since:
    Mar 2010

    Posted 28 Feb 2013 Link to this post

    Okay, this is weird. I found if I set AutoGenerateColumns="True" in the XAML, it pages/sorts/filters correctly, but if I set AutoGenerateColumns="False" it will not refresh the visual display in the grid.  The issue is that I do not want to show every column in our data set so I needed to generate the DataColumns manually based on the user's settings.

    I tried modifying your test project you sent and I could not reproduce my issue, so I have no idea what the problem is. Is there something that is being done when you set AutoGenerateColumns to True, that might potentionally cause an issue like this? I will continue to try to find a workaround.
  5. Michael Evans
    Michael Evans avatar
    31 posts
    Member since:
    Mar 2010

    Posted 28 Feb 2013 Link to this post

    Well, I managed to work around the problem by subscribing to the AutoGeneratingColumn event and then just canceling it:

    private void RadGridView1_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
    {
        e.Cancel = true;
    }

    I'd still be curious to know what it happening behind the scenes to make this work when you set that property as the above solution is more of a hack.
Back to Top