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

Binding of RowDetails

2 Answers 25 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vit100
Top achievements
Rank 1
Vit100 asked on 09 Mar 2011, 03:26 PM
Hi guys,
I have RadGridView which has details for each record.
telerik:RadGridView ItemSource="{Binding CustomerLedger.Transactions}" 
RowDetailsTemplateSelector="{StaticResource transactionDetailTemplateSelector}"
In resources selector configured to show PaymentDetailControl for some record types...

 

<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....

 

2 Answers, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 09 Mar 2011, 04:24 PM
Hello Vitaliy,

That really sounds very very strange.

Would it be possible for you to open a separate support ticket and attach a sample project that demonstrates this behavior? We would really like to see what is going on.

Thanks in advance.

Greetings,
Ross
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Vit100
Top achievements
Rank 1
answered on 09 Mar 2011, 04:52 PM
hm... creating sample project will take time.. i can not just simply copy paste what I have - to much stuff....

will do later.
Tags
GridView
Asked by
Vit100
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Vit100
Top achievements
Rank 1
Share this question
or