I have a RadDateTimePicker being used inside a hosted item on a RadCommandBar. It shows up fine, and is operational, but if I set the value on the RadDateTimePicker at runtime, it doesn't update. The value property of the RadDateTimePicker does get updated, just not visually on the form. Is there a workaround for this?
I'm using 2011.3.11.1229 of the Telerik controls for WinForms.
Here is the code I'm using to create the RadDateTimePickers and assign them to the hosted item:
Dim raddatetimepicker_from As Telerik.WinControls.UI.RadDateTimePickerElement
Dim raddatetimepicker_thru As Telerik.WinControls.UI.RadDateTimePickerElement
'Create RadDataimePickers
raddatetimepicker_from = New Telerik.WinControls.UI.RadDateTimePickerElement
raddatetimepicker_thru = New Telerik.WinControls.UI.RadDateTimePickerElement
raddatetimepicker_thru.MaxDate = DateTime.Today
'Format RadDateTimePickers and insert into host
Dim SizeDTP As New System.Drawing.Size
SizeDTP.Height = 0
SizeDTP.Width = 95
raddatetimepicker_from.MinSize = SizeDTP
raddatetimepicker_thru.MinSize = SizeDTP
raddatetimepicker_from.Format = DateTimePickerFormat.Short
raddatetimepicker_thru.Format = DateTimePickerFormat.Short
'Assign to hosted item on command bar
cbhi_from_date.HostedItem = raddatetimepicker_from
cbhi_thru_date.HostedItem = raddatetimepicker_thru
Here is the code I am using to assign the value, which doesn't cause the RadDateTimePicker to visually update:
raddatetimepicker_from.Value = DateTime.Now.AddDays(DaysBack * -1)
Any help would be great, don't want to have to fallback to the standard DateTimePicker because I don't believe I can host that in a RadCommandBar. Maybe there is some sort of a "refresh" function I should be using, but I haven't needed to do this in the past when the RadDateTimePicker is just on a regular form instead of inside a hosted item.
I'm using 2011.3.11.1229 of the Telerik controls for WinForms.
Here is the code I'm using to create the RadDateTimePickers and assign them to the hosted item:
Dim raddatetimepicker_from As Telerik.WinControls.UI.RadDateTimePickerElement
Dim raddatetimepicker_thru As Telerik.WinControls.UI.RadDateTimePickerElement
'Create RadDataimePickers
raddatetimepicker_from = New Telerik.WinControls.UI.RadDateTimePickerElement
raddatetimepicker_thru = New Telerik.WinControls.UI.RadDateTimePickerElement
raddatetimepicker_thru.MaxDate = DateTime.Today
'Format RadDateTimePickers and insert into host
Dim SizeDTP As New System.Drawing.Size
SizeDTP.Height = 0
SizeDTP.Width = 95
raddatetimepicker_from.MinSize = SizeDTP
raddatetimepicker_thru.MinSize = SizeDTP
raddatetimepicker_from.Format = DateTimePickerFormat.Short
raddatetimepicker_thru.Format = DateTimePickerFormat.Short
'Assign to hosted item on command bar
cbhi_from_date.HostedItem = raddatetimepicker_from
cbhi_thru_date.HostedItem = raddatetimepicker_thru
Here is the code I am using to assign the value, which doesn't cause the RadDateTimePicker to visually update:
raddatetimepicker_from.Value = DateTime.Now.AddDays(DaysBack * -1)
Any help would be great, don't want to have to fallback to the standard DateTimePicker because I don't believe I can host that in a RadCommandBar. Maybe there is some sort of a "refresh" function I should be using, but I haven't needed to do this in the past when the RadDateTimePicker is just on a regular form instead of inside a hosted item.