RadWindow and Silverlight Callout Validators

5 posts, 0 answers
  1. jc
    jc avatar
    6 posts
    Member since:
    Nov 2009

    Posted 19 Nov 2009 Link to this post

    Hi,

    Can somebody help me with this problem?

     

    When i have a textbox control inside the RadWindow, the silverlight validator callout (by default the red tooltip like with white text) does not show even though the exception is thrown. I tried removing the textbox from the RadWindow and it worked, but i really need my textbox control inside the RadWindow.

    Anybody enocuntered this?

    Thanks

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 20 Nov 2009 Link to this post

    Hi Jerome,

    I tried this problem and looks that it works fine. Here is my code:
    <Grid>
        <telerikNavigation:RadWindow x:Name="Window">
            <StackPanel Width="120">
                <TextBox
                        Text="{Binding Path=FullName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" />
                <TextBox
                        Text="{Binding Path=FullName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" />
                <TextBox
                        Text="{Binding Path=FullName, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True}" />
            </StackPanel>
        </telerikNavigation:RadWindow>
    </Grid>
    And code behind:
    public MainPage()
    {
        InitializeComponent();
     
        Window.DataContext = this.DataContext = new Customer { FullName = "ASDASDASD" };
        Window.ShowDialog();
    }
    public class Customer : INotifyPropertyChanged
    {
        private string fullName;
        public string FullName
        {
            get
            {
                return this.fullName;
            }
     
            set
            {
                if (this.fullName != value)
                {
                    if (value.Length < 3)
                    {
                        throw new Exception("ASDF");
                    }
     
                    this.fullName = value;
                    this.OnPropertyChanged(new PropertyChangedEventArgs("FullName"));
                }
            }
        }
     
        protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
        {
            if (this.PropertyChanged != null)
            {
                this.PropertyChanged(this, args);
            }
        }
     
        public event PropertyChangedEventHandler PropertyChanged;
    }

    What I suspect is that you are using a validation summary and it is outside the RadWindow control. This is not working, because the Validation is using VisualTreeHelper.GetParent method to find the route to the visual root. Unfortunately this is not working for any popups (including the RadWindow control).

    If this doesn't help, please send us a sample project that represents the issue. This will help us investigate the problem.

    Kind regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. jc
    jc avatar
    6 posts
    Member since:
    Nov 2009

    Posted 23 Nov 2009 Link to this post

    Hi,

    I tried removing the ValidationSummary but still works the same way.

    For sample purpose, I used the demo application w/c is installed when you install RadControls in my PC. Below is the code inside the DataValidation.Cs project, but modified to show inside a rad window, the Button_click executes winSave.Show();  

    When I compile this w/o the rad window, the callouts show, but if inside the RadWindow it does not.

      <StackPanel> 
            <Button Content="Open window" Click="Button_Click"></Button> 
            <telerikNavigation:RadWindow x:Name="winSave" WindowStartupLocation="CenterOwner" 
                    TopOffset="-50" Width="800">  
                <telerikNavigation:RadWindow.Header> 
                    <Border Width="500">  
                        <TextBlock Text ="Save" HorizontalAlignment="Center"/>  
                    </Border> 
                </telerikNavigation:RadWindow.Header> 
                <Grid x:Name="LayoutRoot" HorizontalAlignment="Center" VerticalAlignment="Center" Width="779" 
                Height="511">  
                    <Grid.Resources> 
                        <ResourceDictionary> 
                            <ResourceDictionary.MergedDictionaries> 
                                <ResourceDictionary  
                                Source="/Examples.DataValidation;component/Silverlight/FirstLook/Styles.xaml" /> 
                            </ResourceDictionary.MergedDictionaries> 
                        </ResourceDictionary> 
                    </Grid.Resources> 
                    <Grid.Background> 
                        <ImageBrush ImageSource="/DataValidation/Images/background.png" /> 
                    </Grid.Background> 
    ...  
    ...  
    ...  
    ...  
    ...  
    ...  
       </StackPanel> 
     
                        <Button x:Name="SubmitButton" Content="Submit" Click="SubmitButton_Click" 
                        HorizontalAlignment="Right" Width="70" Margin="108,5,0,0" /> 
                    </StackPanel> 
                    <StackPanel Margin="0,35,10,0" HorizontalAlignment="Right" VerticalAlignment="Top">  
                        <CheckBox x:Name="ShowValidationSummaryCheckBox" Content="Show validation summary" 
                        IsChecked="True" /> 
                        <CheckBox x:Name="EnableSubmitButtonCheckBox" Content="Disable Submit button on errors" 
                        Checked="EnableSubmitButtonCheckBox_Checked" 
                        Unchecked="EnableSubmitButtonCheckBox_Unchecked" /> 
                    </StackPanel> 
                </Grid> 
            </telerikNavigation:RadWindow> 
     </StackPanel> 
    I don't know if i am just missing something, thanks for the reply.

    Hope to hear from you soon.
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 24 Nov 2009 Link to this post

    Hello Jerome,

    Could you please open a support ticket and send us a project that represents the issue, because I'm not sure I understand what is not displayed and is supposed to be displayed. This will help us a lot in investigating what the problem is.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. jc
    jc avatar
    6 posts
    Member since:
    Nov 2009

    Posted 25 Nov 2009 Link to this post

    Hi,

     

    I was able to isolate the case. the real problem is the themes of the silverlighttoolkit (not rad related).

    thanks for all the help, it is very much apprciated.

Back to Top
DevCraft banner