Hi guys,
I have RadGridView which has details for each record.
In resources selector configured to show PaymentDetailControl for some record types...
I have RadGridView which has details for each record.
telerik:RadGridView ItemSource=
"{Binding CustomerLedger.Transactions}"
RowDetailsTemplateSelector="{StaticResource transactionDetailTemplateSelector}"
<
infrastructure:TransactionDetailTemplateSelector
>
.......
<
infrastructure:TransactionDetailTemplateSelector.PaymentDetailsTemplate
>
<
DataTemplate
>
<
my:PaymentDetailControl
/>
</
DataTemplate
>
</
infrastructure:TransactionDetailTemplateSelector.PaymentDetailsTemplate
>
</
infrastructure:TransactionDetailTemplateSelector
>
So everyting is OK, details control PaymentDetailControl is in DataContext of current record and shows my stuff.
Now I wrap this PaymentDetailControl into border - like this:
<
infrastructure:TransactionDetailTemplateSelector.PaymentDetailsTemplate
>
<
DataTemplate
>
<
Border
>
<
my:PaymentDetailControl
/ >
</
Border
>
</
DataTemplate
>
</
infrastructure:TransactionDetailTemplateSelector.PaymentDetailsTemplate
>
and now PaymentDetailControl is not in current record DataContext, it is not binded anymore.
I found solution - <my:PaymentDetailControl DataContext="{Binding}"/> and everything is working again.
WHY??? I just wraped control into container and datacontext should NOT be changed....
Magic....