This is a migrated thread and some comments may be shown as answers.

DataTable issues

4 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michael Evans
Top achievements
Rank 1
Michael Evans asked on 27 Feb 2013, 09:59 PM
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.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 28 Feb 2013, 06:58 AM
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.

0
Michael Evans
Top achievements
Rank 1
answered on 28 Feb 2013, 01:48 PM
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.?
0
Michael Evans
Top achievements
Rank 1
answered on 28 Feb 2013, 07:05 PM
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.
0
Michael Evans
Top achievements
Rank 1
answered on 28 Feb 2013, 07:41 PM
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.
Tags
GridView
Asked by
Michael Evans
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Michael Evans
Top achievements
Rank 1
Share this question
or