Hi,
I've created a HierarchicalDataTemplate for my items collection which is bound to a business object.
The TemplateSelector chooses which template to use programmatically.
This all works fine.
The DataTemplate code looks like this...
I would like to know how I can have a different click delegate for each button that is shown for the items collection.
Each button repeats per item so all the click events point to the same code. I want each click event to be unique.
Obviously if I knew which item the button belonged to, I could run the appropriate code, but nothing I've tried works.
How do I do this? I'm sure it's a common problem.
Thanks Simon
I've created a HierarchicalDataTemplate for my items collection which is bound to a business object.
The TemplateSelector chooses which template to use programmatically.
This all works fine.
The DataTemplate code looks like this...
<
telerik:HierarchicalDataTemplate
telerik:ContainerBinding.ContainerBindings
=
"{StaticResource TreeViewNodeBindings}"
ItemsSource
=
"{Binding Items}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
telerik:RadButton
x:Name
=
"EditTreeListDataButton"
Content
=
"..."
Click
=
"EditListButton_Click"
/>
<
Image
Stretch
=
"None"
Source
=
"../Resources/treeview_icon_small.png"
VerticalAlignment
=
"Center"
Margin
=
"2"
/>
<
TextBlock
Text
=
"{Binding Header,Mode=OneWay}"
VerticalAlignment
=
"Center"
Margin
=
"2"
FontSize
=
"12"
/>
</
StackPanel
>
</
telerik:HierarchicalDataTemplate
>
I would like to know how I can have a different click delegate for each button that is shown for the items collection.
Each button repeats per item so all the click events point to the same code. I want each click event to be unique.
Obviously if I knew which item the button belonged to, I could run the appropriate code, but nothing I've tried works.
How do I do this? I'm sure it's a common problem.
Thanks Simon