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

ValidationSummary in TabControl - weird behavior

3 Answers 94 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 23 Apr 2011, 07:03 PM
I don't know where should I put this since this is just weird.  So I have 2 stackpanels.  Each panel bind to a different RIA entity.  The first page has just textbox, and second page has the combobox.  Each page has a validation summary

- The textbox is bound to a string on the Entity1, and has required validation and appropriate error message setup.
- The combobox SelectedValue is bound to a foreign key on the Entity2. It has the Range validation with custom verror message.

The expected behaviour is the error happens show up in the ValidationSummary in that tabitem.

The first page works as expected.  However in the second page, the error message is not shown in the ValidationSummary, and the on control error message (the one appear next to the control) only display "The input .is not in a correct format." instead of the proper error message.

If I don't use TabControl (by putting them in on a different grid instead), then the error message should show properly in each ValidationSummary.
        <telerik:RadTabControl>
            <telerik:RadTabItem>
            <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContext="{Binding SelectedPeople}">
                    <TextBlock Text="Last Name:" VerticalAlignment="Center" Padding="15 3 3 3" />
                    <TextBox Name="txtLastName" Text="{Binding lastName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
                                 Width="250" HorizontalAlignment="Left" Padding="3 3 3 3" />
 
                    <TextBlock Text="First Name:" VerticalAlignment="Center" Padding="15 3 3 3" />
                    <TextBox Name="txtFirstName" Text="{Binding firstName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}"
                                 Width="250" HorizontalAlignment="Left" Padding="3 3 3 3" />
                    <input:ValidationSummary Margin="0 30 0 0" />
                    <Button Click="Button_Click" Content="Test"/>
                </StackPanel>
</telerik:RadTabItem>
            <telerik:RadTabItem>
                <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContext="{Binding NewSigOther}" Grid.Column="1">
                    <telerik:RadComboBox Name="cbxRelationship" Width="250" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Left" Padding="3 3 3 3"
                                             ItemsSource="{Binding Data, ElementName=srcDefRelationship}"
                                             SelectedValue="{Binding idRelationshipKey, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True, ValidatesOnNotifyDataErrors=True}"
                                             SelectedValuePath="idRelationshipKey"
                                             DisplayMemberPath="desc1" />
                    <input:ValidationSummary Margin="0 30 0 0"  />
                    <Button Click="Button_Click" Content="Test"/>
                </StackPanel>
            </telerik:RadTabItem>
        </telerik:RadTabControl>

public pplName SelectedPeople
{
    get { return _selectedPeople; }
    set
    {
        if (_selectedPeople != value)
        {
            _selectedPeople = value;
            NotifyPropertyChanged("SelectedPeople");
        }
    }
}
 
public sigOther NewSigOther
{
    get { return _sigOther; }
    set
    {
        if (_sigOther != value)
        {
            _sigOther = value;
            NotifyPropertyChanged("NewSigOther");
        }
    }
}
public Test()
{
    InitializeComponent();
    LayoutRoot.DataContext = this;
    ///tpg1.DataContext = this;
    //tpg2.DataContext = this;
    SelectedPeople = new pplName();
    NewSigOther = new sigOther();
}

3 Answers, 1 is accepted

Sort by
0
Edward
Top achievements
Rank 1
answered on 27 Apr 2011, 05:30 PM
Please disregard this.  I have figure out what was missing/wrong.
0
FLencinas
Top achievements
Rank 1
answered on 23 Jul 2011, 05:01 PM
Hi I have the same problem like you with ValidationSummary an Tabcontrol and receive the message "The input .is not in a correct format"

You know what's the problem...?

Thank's in advance
0
Petar Mladenov
Telerik team
answered on 27 Jul 2011, 01:49 PM
Hi Flencinas,

Could you please elaborate more on your scenario so that we would be better able to assist you? Thank you in advance for your cooperation.

Best wishes,
Petar Mladenov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
TabControl
Asked by
Edward
Top achievements
Rank 1
Answers by
Edward
Top achievements
Rank 1
FLencinas
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or