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

Customising HeaderTemplate

2 Answers 67 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 26 Sep 2010, 04:20 PM
Hi,

I have added some custom commands to my RadPane's HeaderTemplate and TitleTemplate as follows:

<telerikSchema:RadMenuItem CommandTarget="{Binding}" CommandParameter="{Binding}" Command="DashboardCommands:DashboardContentCommands.DeleteContentCommand" Header="{Binding Command.Text, RelativeSource={RelativeSource Self}}" />

The DataContext for each Pane is being set programmatically to a business object and when the commands above fire I would like the business object passed as the CommandParameter. However the CommandParamter is always passed as the string value that the Title or Header property is being set to. I am binding the Header and Title properties to the relevant business object property programatically as follows:

pane.SetBinding(RadPane.HeaderProperty, new Binding() { Source = contentItem, Path = new PropertyPath("ContentName") });
pane.SetBinding(RadPane.TitleProperty, new Binding() { Source = contentItem, Path = new PropertyPath("ContentName") });

Any ideas how I can get the CommandParameter to pass the DataContext of the parent RadPane as opposed to the value of ContentName?

Regards,
Chris


2 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 30 Sep 2010, 07:08 AM
Hello Chris,

Thank you for reporting this, it helps us in improving our products. The Title property is type of string with the current implementation of RadPane. We will consider changing it to object type in our of our future releases. This will resolve the problem you have with the data binding. You can track its progress in our Public Issue Tracking System (PITS) with Issue ID = 3603.

Please do not hesitate to contact us if you require any further information.


Kind regards,
George
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
NOC NOC
Top achievements
Rank 1
answered on 31 Dec 2010, 08:21 PM
.
Tags
Docking
Asked by
Chris
Top achievements
Rank 1
Answers by
George
Telerik team
NOC NOC
Top achievements
Rank 1
Share this question
or