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

SelectableDateEnd not changing when databound type is changed.

3 Answers 123 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Odd Veibust
Top achievements
Rank 1
Odd Veibust asked on 24 Aug 2009, 08:42 AM
Hi.

I have two RadDatePickers, one for datestart and one for dateend, each is databound on the selecteddate property to a datetime variable. This works as it should, but since I do not want the user to be able to select a startdate that is greater then the enddate, and vica verca, I have databound the SelectableDateEnd and SelectableDateStart to the opposite variables. This works fine for the SelectableDateStart property, but doesn't seem to work on the SelectableDateEnd. Can you check and verify if this is a bug or not?  It works fine on initiation, but not when the datatype is changed, so it doesn't seem to pick up the PropertyChangedEvent fireing.

I have also checked that the PropertyChengedEvent is firing on the change of the DateEnd property, and it does.

Thanx in advance.
- Odd

Code:

 

 

<telerikInput:RadDatePicker x:Name="startDate" Width="150"

 

 

SelectedDate="{Binding InvoiceSearch.DateStart, Mode=TwoWay}"

 

 

SelectableDateEnd="{Binding InvoiceSearch.DateEnd, Mode=TwoWay}"></telerikInput:RadDatePicker>

 

 

 


<
telerikInput:RadDatePicker x:Name="endDate" Width="150"

 

 

SelectedDate="{Binding InvoiceSearch.DateEnd, Mode=TwoWay}"

 

 

SelectableDateStart="{Binding InvoiceSearch.DateStart, Mode=TwoWay}"></telerikInput:RadDatePicker>

 

3 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 26 Aug 2009, 08:12 AM
Hi Odd Veibust,

We are sorry for any inconvenience caused. We have tried to reproduce the described issue but without a success. I am attaching a sample project, that is close to your solution. You can check weather it is working for you. Also make sure you have downloaded the latest release(Latest internal build).

Regards,
Kaloyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Tom
Top achievements
Rank 1
answered on 09 Mar 2010, 09:00 PM
I have been experiencing the same problem described here.  We're using the CSLA framework for our business logic layer.  The problem seems to be something to do with the OnPropertyChanged notification in CSLA.  The SelectableDateStart attribute of the second RadDatePicker is bound (one-way) to the StartDate property of the business object (inherits from Csla.BusinessBase<T>).  This SelectedDate attribute of the first RadDatePicker is also bound (two-way) to this property.  The property is defined as:

        protected static PropertyInfo<DateTime> StartDateProperty = RegisterProperty<DateTime>(p => p.StartDate, "Start Date", DateTime.Now);
        public DateTime StartDate 
        { 
            get { 
 
                return GetProperty(StartDateProperty); 
            } 
            set 
            { 
                SetProperty(StartDateProperty, value); 
            } 
        } 

When the SelectedDate of the first RDP is changed it doesn't seem notify the SelectableDateStart of the second RDP.

Strangely changing the default value of the business object property to DateTime.Now.Date seems to fix the problem..
0
Konstantina
Telerik team
answered on 11 Mar 2010, 03:47 PM
Hi Tom,

Thank you for contacting us.

It seems that everything should work as expected. Could you please try modifying the binding of the second RadDatePicker to TwoWay.
If that doesn't resolves your problem could you please send us a sample running project, which we can test here locally in order to assist you in the best manner.

Looking forward to your reply.

Best wishes,
Konstantina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
DatePicker
Asked by
Odd Veibust
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Tom
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or