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

RadComboBox and RadTextBox with custom Validation classes

2 Answers 310 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin Y
Top achievements
Rank 1
Kevin Y asked on 21 Oct 2010, 12:04 AM
I have a WPF application that I am validating ComboBox and TextBox controls using custom Validation classes in XAML.
The following is my ComboBox and it is a required field.  I have not found any examples of similar code for validation using RadComboBox. 
<ComboBox Width="225" VerticalAlignment="Center" IsEditable="True" IsReadOnly="False">
   <ComboBox.ItemTemplate>
      <DataTemplate>
         <TextBlock Text="{Binding}" />
      </DataTemplate>
   </ComboBox.ItemTemplate>
   <ComboBox.Text>
      <Binding Path="Name" UpdateSourceTrigger="LostFocus"
               NotifyOnValidationError="True"
               NotifyOnSourceUpdated="True"
               NotifyOnTargetUpdated="True">
          <Binding.ValidationRules>
             <Validator:RequiredFieldRule FieldName="Field Name Prompt" />
          </Binding.ValidationRules>
       </Binding>
    </ComboBox.Text>
</ComboBox>
Here is my Window.Resources code to display the validation error message:
<Style TargetType="ComboBox">
    <Setter Property="VerticalAlignment" Value="Center" />
    <Style.Triggers>
        <Trigger Property="Validation.HasError" Value="true">
            <Setter Property="ToolTip"
                    Value="{Binding RelativeSource={x:Static RelativeSource.Self},
                            Path=(Validation.Errors).CurrentItem.ErrorContent}" />
RequiredFieldRule is a class in my application derived from ValidationRule.




When I replace 'ComboBox' with ' RadComboBox' the Style used to set the ToolTip with the error message does not work. 
Any help would be greatly appreciated.


2 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 26 Oct 2010, 11:47 AM
Hello Kevin,

Thank you for contacting us.

Could you please share with us which version of the our controls you are using, as we had such problem, but it is already fixed? Providing us with a sample application in which we can observe the issue will be very helpful in determining the source of the issue.

Looking forward to your reply. 

Regards,
George
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
0
Kevin Y
Top achievements
Rank 1
answered on 26 Oct 2010, 04:13 PM
The runtime version of RadControls for WPF we are using is v2.0.50727.
I will provide a sample as soon as possible.  Maybe the problem is already fixed as you mentioned.
Tags
General Discussions
Asked by
Kevin Y
Top achievements
Rank 1
Answers by
George
Telerik team
Kevin Y
Top achievements
Rank 1
Share this question
or