Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
100
only positive integer in a xamdatagrid cell
posted

Hi, I am using a XamDataGrid and inside I have a column of SliceGoal sizes which values can only be integers. Currently I am using XamNumericEditor which forces the user to write only integers. How can I also add a constrain that the value would only be a positive number? Thanks, Alon

 

<dp:UnboundField Name="SliceGoal"

                                                         Width="Auto"

                                           Label="Slice Goal Size"

                                           BindingPath="Model.SliceGoal"

                                           BindingMode="TwoWay"

                                           DataType="{x:Type System:Int64}">

                                            <dp:UnboundField.Settings>

                                                <dp:FieldSettings>

                                                        <dp:FieldSettings.EditorStyle>

                                                        <Style TargetType="{x:Type Editors:XamNumericEditor}">

                                                            <Setter Property="IsReadOnly" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor,

                                                                AncestorType={x:Type dp:CellValuePresenter}}, Path=Record.DataItem.Model.IsSliceGoalReadOnly}" />

                                                        </Style>

                                                        </dp:FieldSettings.EditorStyle>

                                                    </dp:FieldSettings>

                                               </dp:UnboundField.Settings>

                                        </dp:UnboundField>