ValidationSummary in TabControl - weird behavior

4 posts, 0 answers
  1. Edward
    Edward avatar
    83 posts
    Member since:
    Feb 2011

    Posted 23 Apr 2011 Link to this post

    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();
    }
  2. Edward
    Edward avatar
    83 posts
    Member since:
    Feb 2011

    Posted 27 Apr 2011 Link to this post

    Please disregard this.  I have figure out what was missing/wrong.
  3. DevCraft banner
  4. FLencinas
    FLencinas avatar
    1 posts
    Member since:
    Sep 2010

    Posted 23 Jul 2011 Link to this post

    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
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 27 Jul 2011 Link to this post

    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!

Back to Top