Hi,
i'm a beginner of wpf. I use c# and telerik rad controls for wpf. I like to create a simple application with a tabcontrol. I bind a TabViewModel to my TabControl. Also i have a frame control and i load different usercontrols in this frame. In one of these usercontrols i have a RadGridView-control where i load some data from database.
VisualTree:
MainWindow - TabControl - Frame - Usercontrol - RadGirdView
My Problem is, that i have to pass the datacontext from my TabControl to the RadGridView.
Because i want to add a new TabItem out of the DataRow of my RadGridView.
I hope it is clear enough.
Thanks a lot
Best Regards
R
Passing datacontext from usercontrol to RadGridView
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Piyush PansuriyaRank #454 · 5.5K reputationPosted Dec 9, 2014, 11:53 PM EST
You have to add property to radgridview in xaml like :
DataContext="{Binding ElementName=TabControl ,Path=DataContext}"
It will take datacontext of your tabcontrol to RadGridView.