Is it possible to programatically open the details window of the timeline control by clicking on the event title area rather than the timeline event point?
Thanks for any help,
Keith
Hi Keith,
I am looking into your question and will get back to you as soon as I’ve had a chance to look into the details.
I’ll get back to you shortly.
Have you come up with a method? I can set click events on EventTitles just fine, but have not been able to find a way to populate the details box.
Hi,
Let me give you my solution. I re-templated the default EventTitle style, adding a MouseLeftButtonDown event to the background of the grid background.
<Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ig:EventTitle"> <Border HorizontalAlignment="Left" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}"> <Grid Background="{x:Null}" MouseLeftButtonDown="EventItemGrid_MouseLeftButtonDown"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <TextBlock Text="{TemplateBinding FormattedText}" TextWrapping="Wrap" /> <TextBlock Text="{TemplateBinding Title}" TextWrapping="Wrap" Grid.Row="1"/> </Grid> </Border> </ControlTemplate> </Setter.Value> </Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ig:EventTitle">
<Border HorizontalAlignment="Left"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}">
<Grid Background="{x:Null}" MouseLeftButtonDown="EventItemGrid_MouseLeftButtonDown">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock Text="{TemplateBinding FormattedText}" TextWrapping="Wrap" />
<TextBlock Text="{TemplateBinding Title}" TextWrapping="Wrap" Grid.Row="1"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
Then I added this event code to step thru the visual tree parents until you get to the EventTitle so that you could get to the details information. The next step was to set the SelectedTime to the entry Time.
private void EventItemGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Grid g = sender as Grid; DependencyObject dp = VisualTreeHelper.GetParent(g); while (dp != null && dp.GetType() != typeof(EventTitle)) { dp = VisualTreeHelper.GetParent(dp); } if (dp.GetType() == typeof(EventTitle)) { EventTitle et = dp as EventTitle; NumericTimeEntry nte = et.EventEntry as NumericTimeEntry; (this.xamTimeline1.Axis as NumericTimeAxis).SelectedTime = nte.Time; } }
private void EventItemGrid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
Grid g = sender as Grid;
DependencyObject dp = VisualTreeHelper.GetParent(g);
while (dp != null && dp.GetType() != typeof(EventTitle))
dp = VisualTreeHelper.GetParent(dp);
}
if (dp.GetType() == typeof(EventTitle))
EventTitle et = dp as EventTitle;
NumericTimeEntry nte = et.EventEntry as NumericTimeEntry;
(this.xamTimeline1.Axis as NumericTimeAxis).SelectedTime = nte.Time;
Let me know if you have any questions.
Thanks for getting back to me and glad I could help.
Sorry, got tied up and never replied. With your help above I was able to get it all figured out. Thank you for the assistance, it is greatly appreciated.
I haven't heard back from you and I'm wondering if there is anything further I can help with regarding this question.
If so, please feel free to contact me.
I created Feature Request #13630 for you as Teodor suggested to address your requirement.
Our product team chooses new feature request for development based on popular feedback from our customer base. Infragistics continues to monitor application development for all of our products, so as trends appear in requested features, we can plan accordingly.
Our philosophy is to enhance our toolset based on customer feedback. If your feature is chosen for development, you will be notified at that time.
If you would like to follow up on your feature request at a later point, you may contact Developer Support management via email. Please include the reference number of your feature request in the subject and body of your email message. You can reach Developer Support management through the following email address: dsmanager@infragistics.com
Currently, the details are opened by changing the selected time. You can submit a feature request for opening them per event entry here:
http://devcenter.infragistics.com/protected/requestfeature.aspx
In a meantime you can try adding the entries, which are on the same day, with a small difference in times (1 millisecond for example).