Problem with validation notifications

5 posts, 0 answers
  1. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 02 Jun 2011 Link to this post

    I have a tab control that has several tabs. each tab has a user control. All of the user controls are bound to an EF entity via viewModel binding. I've implemented some custom validation to my EF entity using IDataErrorInfo.

    The main control is databound to master viewModel. Each child user control (which represents the contents of a tab) has its datacontext set to a property on the master viewModel (these properties are child viewmodels). These child VM are being instantiated once the master gets the entity from EF.

    When I create a new tab control (for an entity), when it initially displays on the screen all my controls that are validation aware show the red outline I've defined for all properties that are required. But if I switch to a different tab then come back, the outlines are gone even though the value still doesn't pass validation. How do I fix this?

    Is it in the way I have my UI designed? I can change it if needed, just not sure how.
  2. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 02 Jun 2011 Link to this post

    The key was to set the IsContentPreserved property on the TabControl. I've been searching for this for a while now. Not sure why I kept missing it.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 02 Jun 2011 Link to this post

    Discovered something else. I can set the IsContentPreserved and it keeps the outlines for the selected tab. But I've got another tab that isn't selected when the control loads. It has a validation aware control as well, and the outlines are not showing up for it. The tooltip is showing when I hover over the control, but the red outlines are not showing.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 08 Jun 2011 Link to this post

    Hi Rayne,

    We will need more info in order to advice you better. From this view point we cannot tell what causes this behavior. Could you please send us runnable sample demonstrating this behavior ? This way we will investigate it faster. Thank you for your cooperation.

    Regards,
    Petar Mladenov
    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
  6. Rayne
    Rayne avatar
    241 posts
    Member since:
    Sep 2010

    Posted 08 Jun 2011 Link to this post

    Will submit a sample solution. Thanks.
Back to Top
UI for WPF is Visual Studio 2017 Ready