3 Answers, 1 is accepted
0
Hello JTango,
You can refer to the attached example which shows how to partially change the visual presentation of the child grid modifying the ChildDataControlsPresenter control.
A possible solution might look like this:
In this example we change the ColumnsWidthMode property of the child grids to "Fill". You can change any
other properties available within the control as well.
If this is not your scenario, please provide us with more information. We will be glad to assist.
Kind regards,
Nedyalko Nikolov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
You can refer to the attached example which shows how to partially change the visual presentation of the child grid modifying the ChildDataControlsPresenter control.
A possible solution might look like this:
<Style TargetType="{x:Type telerik:ChildDataControlsPresenter}"> |
<Setter Property="Template"> |
<Setter.Value> |
<ControlTemplate TargetType="{x:Type telerik:ChildDataControlsPresenter}"> |
<ItemsControl ItemsSource="{Binding}"> |
<ItemsControl.ItemTemplate> |
<DataTemplate> |
<telerik:GridViewDataControl IsHierarchyRoot="False" ColumnsWidthMode="Auto" |
ItemsSource="{Binding TableDefinition.DataSource}" |
ParentRow="{Binding ParentRow, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:ChildDataControlsPresenter}}}" /> |
</DataTemplate> |
</ItemsControl.ItemTemplate> |
</ItemsControl> |
</ControlTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
In this example we change the ColumnsWidthMode property of the child grids to "Fill". You can change any
other properties available within the control as well.
If this is not your scenario, please provide us with more information. We will be glad to assist.
Kind regards,
Nedyalko Nikolov
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
BILL
Top achievements
Rank 1
answered on 07 Mar 2013, 11:34 PM
Hello,
I am having an issue similar to this post except that I have having issues binding the child datagrid theme to a combobox control....
here is the combobox control
I can bind the parent datagrid theme just fine but the child datagrid theme is always static, I want the child datagrids theme to change when the combobox is selected, just like the parents...
Any help with this would be great....
Thank you,
Jeremiah Tatro
Programmer at United Oil
I am having an issue similar to this post except that I have having issues binding the child datagrid theme to a combobox control....
here is the combobox control
<
telerik:RadComboBox
x:Name
=
"ThemeSelector"
Width
=
"120"
VerticalAlignment
=
"Center"
SelectedIndex
=
"0"
MaxDropDownHeight
=
"220"
>
<
telerikControls:Windows8TouchTheme
/>
<
telerikControls:Windows8Theme
/>
<
telerikControls:Windows7Theme
/>
<
telerikControls:VistaTheme
/>
<
telerikControls:SummerTheme
/>
<
telerikControls:Expression_DarkTheme
/>
<
telerikControls:Office_BlackTheme
/>
<
telerikControls:Office_BlueTheme
/>
<
telerikControls:Office_SilverTheme
/>
<
telerikControls:TransparentTheme
/>
</
telerik:RadComboBox
>
I can bind the parent datagrid theme just fine but the child datagrid theme is always static, I want the child datagrids theme to change when the combobox is selected, just like the parents...
<
telerik:RadGridView
telerikControls:StyleManager.Theme
=
"{Binding SelectedItem, ElementName=ThemeSelector}"
Name
=
"Fuel_Tracking_Grid"
CanUserResizeRows
=
"True"
AutoGenerateColumns
=
"False"
EnableRowVirtualization
=
"True"
GridLinesVisibility
=
"None"
HorizontalContentAlignment
=
"Stretch"
ShowGroupPanel
=
"False"
>
<
telerik:RadGridView.ChildTableDefinitions
>
<
telerik:GridViewTableDefinition
telerikControls:StyleManager.Theme
=
"{Binding SelectedItem, ElementName=ThemeSelector}"
>
<
telerik:GridViewTableDefinition.Relation
>
<
telerik:PropertyRelation
ParentPropertyName
=
"SiteFuelInfoBySites"
/>
</
telerik:GridViewTableDefinition.Relation
>
</
telerik:GridViewTableDefinition
>
</
telerik:RadGridView.ChildTableDefinitions
>
...
<
telerik:RadGridView.HierarchyChildTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Vertical"
telerikControls:StyleManager.Theme
=
"{Binding SelectedItem, ElementName=ThemeSelector}"
>
<
telerik:RadGridView
x:Name
=
"HierarchicalGridView"
telerikControls:StyleManager.Theme
=
"{Binding SelectedItem, ElementName=ThemeSelector}"
ShowGroupPanel
=
"False"
AutoGenerateColumns
=
"False"
ItemsSource
=
"{Binding Path=SiteFuelInfoByTanks}"
CanUserResizeRows
=
"True"
EnableRowVirtualization
=
"True"
GridLinesVisibility
=
"None"
HorizontalContentAlignment
=
"Stretch"
>
<
telerik:RadGridView.Columns
>
Any help with this would be great....
Thank you,
Jeremiah Tatro
Programmer at United Oil
0
Hello,
Nedyalko Nikolov
the Telerik team
Unfortunately there is a problem when using Binding.ElementName in a data template (there are some problems with the visual tree).
Could you please try to use Binding.RelativeSource option (for example to bind Parent and Child grids themes)?
Nedyalko Nikolov
the Telerik team
Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.