开发者

In DevExpress TextEdit How to enter value with 3 decimal places and value should be max 1000

开发者 https://www.devze.com 2023-04-06 00:15 出处:网络
I am using devexpress TextEditSettings in dxgrid in editsetting开发者_运维问答s.. How can i restrict the user to enter value with 3 decimal places and value range should be 0-1000Give this a try:

I am using devexpress TextEditSettings in dxgrid in editsetting开发者_运维问答s..

How can i restrict the user to enter value with 3 decimal places and value range should be 0-1000


Give this a try:

xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"

<Style x:Key="DXTextEdit_Numeric_Style" TargetType="{x:Type dxe:TextEdit}">
    <Setter Property="Mask" Value="000.000;000.000-" />
    <Setter Property="MaskType" Value="Numeric"/>
    <Setter Property="DisplayFormatString" Value="000.000;000.000-"/>
    <Setter Property="MaskUseAsDisplayFormat" Value="True"/>
</Style>

EDIT:

Give this a try:

You will have to specify your column:

xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"

<dxg:GridColumn FieldName="SomeFieldName" Width="110" FilterPopupMode="CheckedList">
                    <dxg:GridColumn.EditSettings>
                        <dxe:TextEditSettings Style="{DynamicResource GridColumnStyle_Text}" />
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>

Then your style:

<Style x:Key="GridColumnStyle_Numeric" TargetType="{x:Type dxe:TextEditSettings}">
    <Setter Property="Mask" Value="000.000;000.000-" />
    <Setter Property="MaskType" Value="Numeric"/>
    <Setter Property="FlowDirection" Value="RightToLeft"/>
    <Setter Property="DisplayFormatString" Value="000.000;000.000-"/>
    <Setter Property="MaskUseAsDisplayFormat" Value="True"/>
</Style>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号