Search

TabControl doesn't display Validation error information correctly when switching tabs back and forth. by Curelom

Active

12
Sign in to vote
0
Sign in to vote
Sign in
to vote
Type: Bug
ID: 295933
Opened: 8/30/2007 2:50:36 PM
Access Restriction: Public
2
Workaround(s)
2
User(s) can reproduce this bug
TabControl doesn't display Validation error information correctly when switching tabs back and forth. Setting the Validation.ErrorTemplate on textboxes in a tabitem, then causing a validationrule to fire, the errortemplate displays correctly, however
After tabbing to another tab, then back, the controls in the error template no longer display.
Details (expand)
Product Language
English

Version

Visual Studio Code Name "Orcas" (Beta 2)
Operating System
Windows Vista
Operating System Language
English
Steps to Reproduce
See msdn forum link for further details https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1602810&SiteID=1

Create tabcontrol with several tabitems, each containing several textboxes.

Create ControlTemplate containing adornedelementplaceholder, plus additional controls such as an Image such as below
<ControlTemplate x:Key="validationTemplate">
<DockPanel LastChildFill="True">
<Border BorderBrush="Red" BorderThickness="2">
<AdornedElementPlaceholder Name="MyAdorner"/>
</Border>
<Image Width="32" Height="32"
Source="pack://application:,,,/Resources/Images/bullet_ball_glass_red.png" Opacity="0.75"
ToolTip="{Binding ElementName=MyAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"
/>
</DockPanel>
</ControlTemplate>

Using a style and setter property="Validation.ErrorTemplate", apply this template to textboxes as below
<Style x:Key="{x:Type TextBox}" TargetType="{x:Type TextBoxBase}">
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource validationTemplate}" />
...

Create some validation rules, then cause a validation rule to fire on one of the tabs, displaying the errrortemplate on the textbox. Tab to another tab, then tab back. errortemplate is no longer displayed.
Actual Results
After tabbing back and forth, error template is no longer displayed.
Expected Results
errortemplate should still be displayed after tabbing back and forth between tabitems.
TAP Code (if applicable)
 
      You can indicate your satisfaction with how Microsoft handled this issue by completing this quick 3 question survey. [Details]

 

File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 8/30/2007 at 6:12 PM
Thank you for your feedback. We are currently investigating. If this issue is urgent, please call support directly (see http://support.microsoft.com). Thank you, Visual Studio Product Team.
Posted by Microsoft on 8/31/2007 at 3:27 AM
Thanks for your feedback. We have reproduced this bug on Visual Studio 2008 Beta 2, and we are sending this bug to the appropriate group within the VisualStudio Product Team for triage and resolution.

Thank you,
Visual Studio Product Team.
Posted by Microsoft on 3/12/2009 at 3:43 PM
Thank you for reporting this issue. Though this issue is under investigation, we will likely not have a fix available in .NET 4.0. We will update this bug again when we are able to fix the issue in a future release. Thanks!
Posted by Roger Hill on 12/16/2009 at 2:28 AM
I had a similar issue with a TabControl with data bound controls on various tab panes.
The data bound controls were not always displaying as expected when switching between Tabs. (i.e. combo boxes were blank/greyed out when they should not have been)
Adding an AdornerDecorator to my Tab Pane template got rid of the problem.