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

Loading RadDataSource in Code Behind

1 Answer 82 Views
DomainDataSource
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 29 Sep 2011, 06:06 PM
I am sure I am doing something simple wrong but cannot seem to get the datasource to load from the codebehind page. Here is what I am trying to do:

myDataSource = new RadDomainDataSource();
myDataSource.DataContext = new BusinessApplication3.Web.DomainServices.myDomainContext();
               
myDataSource.QueryName = "GetUser";
myDataSource.LoadedData += new EventHandler<Telerik.Windows.Controls.DomainServices.LoadedDataEventArgs>(myDataSource_LoadedData);
myDataSource.LoadingData += new EventHandler<Telerik.Windows.Controls.DomainServices.LoadingDataEventArgs>(myDataSource_LoadingData);
myDataSource.AutoLoad = false;
               
myDataSource.Load();


I have breakpoints at both of the LoadedData and the LoadingData calls to see when it hits. However even with the myDataSource.Load() call it never seems to hit the break points. To be sure it compiles and runs without any errors and the query is correct.

I've done a test of putting all this onthe XAML side of things and it hits those calls as expected so I believe I am missing a bit of plumbing in the code behind but can't figure out what it is.

Any help would be greatly appreciated.

Thanks,
Eric

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 30 Sep 2011, 06:35 AM
Hello Eric,

 Why not use QueryableDomainServiceCollectionView<> directly similar to this demo?

Regards,
Vlad
the Telerik team

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

Tags
DomainDataSource
Asked by
Eric
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or