Hold event

3 posts, 1 answers
  1. vzaytzev
    vzaytzev avatar
    6 posts
    Member since:
    Dec 2007

    Posted 09 Oct 2012 Link to this post

    Is it possible to update SelectedValue on Hold event? Or if not, how can I get the date at specific coordinates?
  2. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 12 Oct 2012 Link to this post

    Hi Vasily,

    Sorry for the delayed reply. You can obtain the date from coordinates using the following approach:

    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <StackPanel>
            <TextBlock HorizontalAlignment="Center" FontSize="24" x:Name="log" />
            <telerik:RadCalendar x:Name="calendar1" Hold="calendar1_Hold" />
        </StackPanel>
    </Grid>
     
    private void calendar1_Hold(object sender, System.Windows.Input.GestureEventArgs e)
    {
        FrameworkElement source = e.OriginalSource as FrameworkElement;
        CalendarButton calendarButton = ElementTreeHelper.FindVisualAncestor<CalendarButton>(source);
        CalendarButtonContentInfo info = calendarButton.Content as CalendarButtonContentInfo;
        this.log.Text = info.Date.ToString();
    }

    Give it a try and let me know how it goes. I'd be glad to further assist you.

    Regards,
    Kiril Stanoev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. vzaytzev
    vzaytzev avatar
    6 posts
    Member since:
    Dec 2007

    Posted 12 Oct 2012 Link to this post

    Thanks, works fine.
Back to Top