How to set Sample DataContext to WrapDataGridPageSmall.xaml?

Apr 30, 2009 at 10:20 PM
Edited Apr 30, 2009 at 10:23 PM


I am trying to run sample WrapDataGridPageSmall.xaml in silver light 3.0 and facing difficulty in setting up the DataContext. I have seen the implementation in samples that is first setting up DataManager and then assigning it to DataContext.<o:p></o:p>

<data:DataManager x:Name="DataManager" IsvDataProvider="{StaticResource IsvDataProvider}" RuleManager="{StaticResource RuleManager}">

DataContext="{StaticResource DataManager}"

So my question is how that DataManger is getting data and how can I use DataManger to provide Sample data to WrapDataGridPageSmall? I have searched through sample application solution and did not find clue how/where DataManger is getting data.




May 14, 2009 at 10:08 AM

The data manager is just an IEnumerable source. You data can be from any IEnumerable source. You just need to make sure that the templates you apply to your columns for the various views are properties on your objects.

WrapDataGrid.cs has a function RenderData which adds the data to the grid. If you place a breakpoint in thie function at <font size="2" color="#0000ff"><font size="2" color="#0000ff">


</font></font><font size="2" color="#0000ff">



(object rowDictionary in this.provider)"<font size="2">



you should be able to trace the calls into the data manager, but I suspect you would be better to use your own collection than to try and pick apart our sample data manager.