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

RadWindow and Silverlight Callout Validators

4 Answers 95 Views
Window
This is a migrated thread and some comments may be shown as answers.
jc
Top achievements
Rank 1
jc asked on 19 Nov 2009, 06:50 AM

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

4 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 20 Nov 2009, 01:52 PM
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.
0
jc
Top achievements
Rank 1
answered on 24 Nov 2009, 03:40 AM
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.
0
Miroslav Nedyalkov
Telerik team
answered on 24 Nov 2009, 12:59 PM
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.
0
jc
Top achievements
Rank 1
answered on 26 Nov 2009, 12:30 AM

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.

Tags
Window
Asked by
jc
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
jc
Top achievements
Rank 1
Share this question
or