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

Adding Button to RadChart MarkedZone

4 Answers 90 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Christopher Bier
Top achievements
Rank 1
Christopher Bier asked on 26 Jul 2011, 12:55 PM
Hi,

I am trying to add a button to the template of a RadChart MarkedZone, see code below:

<telerikCharting:MarkedZone x:Name="MarkedZone" 
			StartX="1.5" 
			EndX="4.5"
 			Background="#7ED3D3D3" 
			StrokeThickness="1" 
			Stroke="Gray" >
	<telerikCharting:MarkedZone.Template>
		<ControlTemplate TargetType="telerikCharting:MarkedZone" >
			<Border x:Name="MarkedZoneBorder" 
																	Margin="{TemplateBinding ElementMargin}" 
																	BorderBrush="Gray" 
																	BorderThickness="1" 
																	Background="{TemplateBinding Background}">
				<Grid x:Name="MarkedZoneBorderGrid">
					<Grid.RowDefinitions>
						<RowDefinition Height="Auto" />
						<RowDefinition Height="*" />
					</Grid.RowDefinitions>
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="*" />
						<ColumnDefinition Width="Auto" />
					</Grid.ColumnDefinitions>
					<TextBlock Margin="10" 
																	   				Text="Culture Cycle Members" />
					<Button Grid.Column="1"
						Margin="10" 
																				Cursor="Hand" 
																				Command="{Binding DoSomething}"  />
 				</Grid>
			</Border>
		</ControlTemplate>
	</telerikCharting:MarkedZone.Template>
</telerikCharting:MarkedZone>

The button (and TextBlock) shows up fine but are unable to be clicked by the User (no Hand Cursor either)
I assume this is because there is another UI element sitting over the top of it?
Is there any other way to do this to allow the button to be clicked?

Thanks,
Chris

4 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 27 Jul 2011, 01:53 PM
Hi Christopher,

Your question was answered in the Support thread you've started - Ticket ID: 447825. Please keep the conversation in a single thread so that it's easier for you and us to follow it.

Best wishes,
Evgenia
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Abdul
Top achievements
Rank 1
answered on 12 Aug 2011, 08:07 PM
Can you please provide me the solution to the issue? I have a button in the MarkedZone but I cannot get the clicked event.
0
Christopher Bier
Top achievements
Rank 1
answered on 15 Aug 2011, 08:41 AM
Hi Abdul,

Solution from Telerik:
To be able to click on the button and the TextBox inside the MarkedZones you should retemplate the Chart Area and put the Annotations Layer within the Zoom Layer.

Thanks,
Chris
0
Evgenia
Telerik team
answered on 15 Aug 2011, 11:50 AM
Hi Abdul,

The sample project attached demonstrates how you can achieve this by retemplating the ChartArea style (as Christopher mentioned - you'll need to put the Annotations Layer within the Zoom Layer).

Greetings,
Evgenia
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Tags
Chart
Asked by
Christopher Bier
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Abdul
Top achievements
Rank 1
Christopher Bier
Top achievements
Rank 1
Share this question
or