Russell Mason
Top achievements
Rank 1
Russell Mason
asked on 14 Dec 2009, 10:01 PM
Hi
Do you have an example of how to set the ContentTemplate of a RadWindow? I want to have information above and below the actual Content as set by the property but when I set the ContentTemplate the actual Content disappears. I'm obviously doing something wrong.
Thanks
Russell Mason
Do you have an example of how to set the ContentTemplate of a RadWindow? I want to have information above and below the actual Content as set by the property but when I set the ContentTemplate the actual Content disappears. I'm obviously doing something wrong.
Thanks
Russell Mason
3 Answers, 1 is accepted
0
Hi Russell,
All the best,
Miroslav Nedyalkov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Here is an example of a ContentTemplate of the RadWindow control:
<
DataTemplate
>
<
Grid
Background
=
"White"
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
TextBlock
Text
=
"Some Header"
Grid.Row
=
"0"
/>
<
ContentPresenter
Grid.Row
=
"1"
Content
=
"{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
/>
<
TextBlock
Text
=
"Some Footer"
Grid.Row
=
"2"
/>
</
Grid
>
</
DataTemplate
>
All the best,
Miroslav Nedyalkov
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Derek
Top achievements
Rank 1
answered on 17 Oct 2013, 12:49 PM
HI,
This is my first post so please forgive me if I do not provide enough information! I would like to do the same thing as shown below but with the added complication of binding data.
Example ({Binding HeaderText}):
This is my first post so please forgive me if I do not provide enough information! I would like to do the same thing as shown below but with the added complication of binding data.
Example ({Binding HeaderText}):
<
DataTemplate
>
<
Grid
Background
=
"White"
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
TextBlock
Text
=
"{Binding HeaderText}"
Grid.Row
=
"0"
/>
<
ContentPresenter
Grid.Row
=
"1"
Content
=
"{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
/>
<
TextBlock
Text
=
"Some Footer"
Grid.Row
=
"2"
/>
</
Grid
>
</
DataTemplate
>
How is this accomplished? My requirements are actually for a list of mulitple items as shown below:
<
ScrollViewer
VerticalScrollBarVisibility
=
"Auto"
HorizontalScrollBarVisibility
=
"Auto"
MaxHeight
=
"100"
MinHeight
=
"100"
MinWidth
=
"100"
>
<
ItemsControl
ItemsSource
=
"{Binding NonInstructAccounts}"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding [AccountNumber].TextValue}"
/>
<
TextBlock
Text
=
"{Binding [AccountNameLine1].TextValue}"
Margin
=
"10,0,0,0"
/>
</
StackPanel
>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
</
ItemsControl
>
</
ScrollViewer
>
0
Hi Derek,
In order to display a collection of Items you would need to set the ContentTemplate of the ContentPresenter the desired way. It should look like follows:
Hope this helps. If you have any other questions let us know.
Regards,
Kalin
Telerik
In order to display a collection of Items you would need to set the ContentTemplate of the ContentPresenter the desired way. It should look like follows:
...
<
ContentPresenter
Grid.Row
=
"1"
Content
=
"{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
>
<
ContentPresenter.ContentTemplate
>
<
DataTemplate
>
<
ScrollViewer
VerticalScrollBarVisibility
=
"Auto"
HorizontalScrollBarVisibility
=
"Auto"
MaxHeight
=
"100"
MinHeight
=
"100"
MinWidth
=
"100"
>
<
ItemsControl
ItemsSource
=
"{Binding NonInstructAccounts}"
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding [AccountNumber].TextValue}"
/>
<
TextBlock
Text
=
"{Binding [AccountNameLine1].TextValue}"
Margin
=
"10,0,0,0"
/>
</
StackPanel
>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
</
ItemsControl
>
</
ScrollViewer
>
</
DataTemplate
>
</
ContentPresenter.ContentTemplate
>
</
ContentPresenter
>
...
Hope this helps. If you have any other questions let us know.
Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>