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

NullpointerException on AppointmentItem.EnsureSelection

3 Answers 44 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Nico
Top achievements
Rank 1
Nico asked on 13 Sep 2011, 02:24 PM
Hi,

I've got a nullpointer exception in AppointmentItem.EnsureSelection method. The occurrenceInfo is null.

void EnsureSelected()
{
    if (!this.IsSelected)
    {
        this.ScheduleView.UpdateSelectionOnMouseButton(this.occurrenceInfo.Occurrence, this.ActualRange, false, true, true, false);
    }
}

In the mouse handlers the occurrenceInfo is checked against being null:

private void AppointmentItemMouseRightButtonDown(object sender, MouseButtonEventArgs e)
    {
        if (this.ScheduleView != null && this.occurrenceInfo != null)
        {
            this.ScheduleView.UpdateSelectionOnMouseButton(this.occurrenceInfo.Occurrence, this.ActualRange, false, false);
            e.Handled = true;
        }
    }

    private void AppointmentItemMouseRightButtonUp(object sender, MouseButtonEventArgs e)
    {
        if (this.ScheduleView != null && this.occurrenceInfo != null)
        {
            this.ScheduleView.UpdateSelectionOnMouseButton(this.occurrenceInfo.Occurrence, this.ActualRange, false, true);
            e.Handled = false;
        }
    }

Could you fix this?
Thx,
Nico

3 Answers, 1 is accepted

Sort by
0
Nico
Top achievements
Rank 1
answered on 13 Sep 2011, 02:25 PM
Hi,

Maybe the build is also of importance WPF40 2011 2 0823

0
Ivo
Telerik team
answered on 20 Sep 2011, 11:18 AM
Hello Nico,

We are not able to reproduce this. We want to investigate this further so it would be great if you open a support ticket and send us a sample example reproducing this issue.

All the best,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Nico
Top achievements
Rank 1
answered on 20 Sep 2011, 03:29 PM
Well,

I can't really reproduce this in a simple project. It happens when start dragging while another thread uses the control's Dispatcher.BeginInvoke action to reset the AppointmentsSource.

I'll see if I can create a sample project.
Thx for looking into this.
Tags
ScheduleView
Asked by
Nico
Top achievements
Rank 1
Answers by
Nico
Top achievements
Rank 1
Ivo
Telerik team
Share this question
or