AllowCommitOnValidationAttributeError 无效
本帖最后由 houlisus 于 2016-10-18 16:12 编辑版本: devexpress wpf 15.2
gridcontol cell验证,设置tableview AllowCommitOnValidationAttributeError="True",目的是验证错误的时候可以编辑其他cell
结果AllowCommitOnValidationAttributeError不起作用,cell验证错误就无法编辑其他东西了,不知道什么原因,求助各位大神,谢谢!
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
xmlns:local="clr-namespace:zjhky.ui"
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
xmlns:collections="clr-namespace:System.Collections;assembly=mscorlib"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
x:Class="zjhky.ui.ControllerCostsPage"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="900">
<Grid MinHeight="600">
<Grid.RowDefinitions>
<RowDefinition Height="25"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<Button x:Name="addBt" Width="100">添加</Button>
<Button x:Name="deleteBt" Width="100">删除</Button>
</StackPanel>
<dxg:GridControl Grid.Row="1" x:Name="gridControl" AutoGenerateColumns="AddNew" SelectionMode="Row">
<dxg:GridControl.Columns>
<dxg:GridColumn Name="SnCol" FieldName="Sn" Header="序号" Width="60" HorizontalHeaderContentAlignment="Center" ReadOnly="True"/>
<dxg:GridColumn Name="AppCol" FieldName="AppObject" Header="应用对象" HorizontalHeaderContentAlignment="Center">
<dxg:GridColumn.EditSettings>
<dxe:ComboBoxEditSettings x:Name="appTypecbe"
DisplayMember="name" ValueMember="Id"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Name="NameCol" FieldName="Name" Header="设备材料名称" HorizontalHeaderContentAlignment="Center">
<dxg:GridColumn.EditSettings>
<dxe:TextEditSettings AllowNullInput="False" />
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Name="ModelTypeCol" FieldName="ModelType" Header="规格型号" HorizontalHeaderContentAlignment="Center"/>
<dxg:GridColumn Name="UnitCol" FieldName="Unit" Header="单位" HorizontalHeaderContentAlignment="Center"/>
<dxg:GridColumn Name="QuantityCol" FieldName="Quantity" Header="数量" HorizontalHeaderContentAlignment="Center">
<dxg:GridColumn.EditSettings>
<dxe:SpinEditSettings DisplayFormat="D" MaskType="Numeric" MinValue="0" AllowDefaultButton="False" IsFloatValue="False"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Name="UnitCostCol" FieldName="UnitCost" Header="单价(元)" HorizontalHeaderContentAlignment="Center">
<dxg:GridColumn.EditSettings>
<dxe:SpinEditSettings DisplayFormat="F2"MaskType="Numeric" AllowDefaultButton="False"/>
</dxg:GridColumn.EditSettings>
</dxg:GridColumn>
<dxg:GridColumn Name="TotalPriceCol" FieldName="TotalPrice" Header="总价(元)" HorizontalHeaderContentAlignment="Center" ReadOnly="True"/>
<dxg:GridColumn Name="PurposeCol" FieldName="Purpose" Header="用途" HorizontalHeaderContentAlignment="Center"/>
<dxg:GridColumn Name="CommentCol" FieldName="Comment" Header="备注" HorizontalHeaderContentAlignment="Center"/>
</dxg:GridControl.Columns>
<dxg:GridControl.TotalSummary>
<dxg:GridSummaryItem FieldName="TotalPrice" SummaryType="Sum" DisplayFormat="合计: {0:c2}"/>
</dxg:GridControl.TotalSummary>
<dxg:GridControl.View>
<dxg:TableView x:Name="controlTV" AllowScrollAnimation="True" ShowValidationAttributeErrors="True" AllowCommitOnValidationAttributeError="True" ShowGroupPanel="False" AllowPerPixelScrolling="True" ShowTotalSummary="True" AllowColumnMoving="False" ShowCheckBoxSelectorColumn="True" AllowMoveColumnToDropArea="False" AllowSorting="False" AutoMoveRowFocus="False"/>
</dxg:GridControl.View>
</dxg:GridControl>
</Grid>
</UserControl>
页:
[1]