I seem to have run into some trouble with the validation of a cell in my GridView. Should this control automatically validate on exceptions? It still does so, even after removing the validation tags from my xaml.
Anyway, my actual issue is that whenever I want to add a new row and then click cancel before editing any of the cells, the validation occurs, thus not letting me delete the row or cancel the operation (with a cancel button doint rejectchanges) before I enter an actual value and the validation of the field is ok.
Here's the grid (I've just renamed some elements to "XX" before pasting this):
The problem here being that the cells in the "Name" column seems to validate no matter if "ValidatesOnExceptions=true" is set in the XAML or not.
Is there a workaround or solution to this, letting me delete the row either without the validation occurring or with the validation still being active (I.e red border around the cell)?
I should also mention that the 'ToolStringInfo' class is an entity class (EntityFramework) set to ne "not null" in the database.
Anyway, my actual issue is that whenever I want to add a new row and then click cancel before editing any of the cells, the validation occurs, thus not letting me delete the row or cancel the operation (with a cancel button doint rejectchanges) before I enter an actual value and the validation of the field is ok.
Here's the grid (I've just renamed some elements to "XX" before pasting this):
<
telerik:RadGridView
x:Name
=
"ToolStringView"
ItemsSource
=
"{Binding Path=SelectedRun.ToolStringInfo, Mode=TwoWay}"
IsEnabled
=
"{Binding ElementName=runPage, Path=HasWritePermission}"
Margin
=
"20,20,40,0"
Width
=
"450"
MinHeight
=
"300"
MaxHeight
=
"500"
FontFamily
=
"Segoe UI"
FontSize
=
"14"
CanUserFreezeColumns
=
"False"
RowIndicatorVisibility
=
"Collapsed"
telerik:StyleManager.Theme
=
"Metro"
ShowGroupPanel
=
"False"
ShowInsertRow
=
"True"
IsFilteringAllowed
=
"False"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewColumn
Width
=
"30"
>
<
telerik:GridViewColumn.CellTemplate
>
<
DataTemplate
>
<
XX_Silverlight_Library_Controls:DeleteButton
Width
=
"20"
Height
=
"20"
telerik:StyleManager.Theme
=
"Metro"
FontFamily
=
"Segoe UI"
FontSize
=
"14"
Command
=
"{Binding DeleteToolStringInfoCommand, Source={StaticResource runViewModel}}"
CommandParameter
=
"{Binding}"
/>
</
DataTemplate
>
</
telerik:GridViewColumn.CellTemplate
>
</
telerik:GridViewColumn
>
<
telerik:GridViewDataColumn
Header
=
"Name"
DataMemberBinding
=
"{Binding Name}"
Width
=
"*"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Depth, Mode=TwoWay}"
Header
=
"Depth"
MinWidth
=
"100"
Width
=
"*"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
StackPanel.Resources
>
<
XX_Silverlight_Library_Util:XXValueConverter
x:Name
=
"RunViewValueConverter"
ConvertTo
=
"{Binding Source={StaticResource runViewModel}, Path=Range.CurrentUnit}"
/>
</
StackPanel.Resources
>
<
XX_Silverlight_Library_Controls:XXNumericControl
Width
=
"150"
NumericValue
=
"{Binding Depth, Mode=TwoWay, Converter={StaticResource RunViewValueConverter}}"
FontFamily
=
"Segoe UI"
FontSize
=
"14"
telerik:StyleManager.Theme
=
"Metro"
>
</
XX_Silverlight_Library_Controls:XXNumericControl
>
<
TextBlock
Text
=
"{Binding Path=UnitLabel, ElementName=RunViewValueConverter, FallbackValue=NA}"
FontFamily
=
"Segoe UI"
FontSize
=
"14"
VerticalAlignment
=
"Bottom"
Margin
=
"0,0,0,3"
Width
=
"50"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
<
telerik:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
StackPanel.Resources
>
<
XX_Silverlight_Library_Util:XXValueConverter
x:Name
=
"RunViewValueConverter"
ConvertTo
=
"{Binding Source={StaticResource runViewModel}, Path=Range.CurrentUnit}"
/>
</
StackPanel.Resources
>
<
XX_Silverlight_Library_Controls:XXNumericControl
Width
=
"150"
NumericValue
=
"{Binding Depth, Mode=TwoWay, Converter={StaticResource RunViewValueConverter}}"
FontFamily
=
"Segoe UI"
FontSize
=
"14"
telerik:StyleManager.Theme
=
"Metro"
>
</
XX_Silverlight_Library_Controls:XXNumericControl
>
<
TextBlock
Text
=
"{Binding Path=UnitLabel, ElementName=RunViewValueConverter, FallbackValue=NA}"
FontFamily
=
"Segoe UI"
FontSize
=
"14"
VerticalAlignment
=
"Bottom"
Margin
=
"0,0,0,3"
Width
=
"50"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellEditTemplate
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
<
i:Interaction.Behaviors
>
<
XX_Silverlight_Library_Controls_Keyboard_Behaviors:ShowKeyboardBehavior
></
XX_Silverlight_Library_Controls_Keyboard_Behaviors:ShowKeyboardBehavior
>
</
i:Interaction.Behaviors
>
</
telerik:RadGridView
>
The problem here being that the cells in the "Name" column seems to validate no matter if "ValidatesOnExceptions=true" is set in the XAML or not.
Is there a workaround or solution to this, letting me delete the row either without the validation occurring or with the validation still being active (I.e red border around the cell)?
I should also mention that the 'ToolStringInfo' class is an entity class (EntityFramework) set to ne "not null" in the database.