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

[Solved] DataContext always binding to same SampleData source?

1 Answer 98 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rob Ainscough
Top achievements
Rank 1
Rob Ainscough asked on 02 Nov 2011, 11:28 PM
Whenever I create a new RadGridView in my Project (UserControl) the DataContext seems to always bind to the same SampleData source I have in my project (as a "default" without me doing anything) ... in Common Properties (under Blend 4) it will display DataContext (MySampleData).  There is nothing in XAML that indicates this binding so it appears to be inherited??

This starts to be a problem if I try Data Binding on ItemsSource for the RadGridView - Blend 4 will crash (unhandled exception) if I select any other SampleData (say "MyOtherSampleData") that isn't "MySampleData".

As a work around I have to manually enter DataContext="{Binding Source={StaticResource MyOtherSampleData}}" in XAML for the RadGridView -- BEFORE I attempt to Data bind the ItemSource.

Is this something I'm doing wrong or a bug with Blend 4 or a Bug with RadGridView?

Thanks, Rob.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 03 Nov 2011, 08:03 AM
Hi Rob,

 Can you post more info about the grid version? 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Rob Ainscough
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or