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

RowDetailsTemplate custom user control

1 Answer 155 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bertha
Top achievements
Rank 1
Bertha asked on 14 Jan 2013, 07:43 PM
I want to pass in value into the custom User Control "CustomerBilling " programmatically inside tab control for each row in RadGridView.  Which event should I call?  Is it RowLoaded?  How I could I access the User Control of "CustomerBilling" in C#?  In Xaml, I could just type the paramter "ModifiedBy", but I do not want to set the value in there.  How could I do it via RowLoaded event? Thanks.
<telerik:RadGridView.RowDetailsTemplate>
               <DataTemplate>
                   <telerik:RadTabControl Name="RadTabControl1" Width="702" HorizontalAlignment="Center"
                                          Margin="8" VerticalAlignment="Center" >
                       <telerik:RadTabItem Header="Billing Address"  >
                           <local:CustomerBilling ModifiedBy="adfdf" />
                       </telerik:RadTabItem>
                       <telerik:RadTabItem Header="Shipping Address" >
                           <local:CustomersShipping />
                       </telerik:RadTabItem>
                   </telerik:RadTabControl>
               </DataTemplate>
           </telerik:RadGridView.RowDetailsTemplate>

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 15 Jan 2013, 07:43 AM
Hello,

 It will be better to use MVVM to achieve your goal. You can bind a property of your user control to some property of the data item associated with this row. For example:

<local:CustomerBilling ModifiedBy="{Binding MyProperty}" />

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

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