Hello,
Found a potential bug in the private DataFormDataField.SetLabelStyle() method. Basically, a user of the DataForm control can cause an exception of their lable content is not the same type as that specified in the LabelStyle's TargetType. As a fix, we can just check the types and apply if the are compatible. Here is how to fix the bug:
1) In the 'Telerik.Windows.Controls.DataFormDataField' class, you will see the SetLabelStyle method defined as:
Replace this method with:
Please use this fix until Telerik gets around to correcting the bug.
- Rashad Rivera, Omegus Prime, LLC
Found a potential bug in the private DataFormDataField.SetLabelStyle() method. Basically, a user of the DataForm control can cause an exception of their lable content is not the same type as that specified in the LabelStyle's TargetType. As a fix, we can just check the types and apply if the are compatible. Here is how to fix the bug:
1) In the 'Telerik.Windows.Controls.DataFormDataField' class, you will see the SetLabelStyle method defined as:
private void SetLabelStyle() { FrameworkElement label = this.GetTemplateChild("PART_Label") as FrameworkElement; if (label != null && this.ParentForm != null && this.ParentForm.LabelStyle != null) { label.Style = this.ParentForm.LabelStyle; }}Replace this method with:
private void SetLabelStyle() { FrameworkElement label = this.GetTemplateChild("PART_Label") as FrameworkElement; if (label != null && this.ParentForm != null && this.ParentForm.LabelStyle != null && this.ParentForm.LabelStyle.TargetType.IsCompatibleWith(label.GetType())) { label.Style = this.ParentForm.LabelStyle; }}Please use this fix until Telerik gets around to correcting the bug.
- Rashad Rivera, Omegus Prime, LLC