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.
- 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();
}