RoundingDecimalPlace value for DataGridDoubleColumn is not specified.

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 3 months ago by Yuki Ogawa
Version: 21.1.3
Platform: .NET 5.0
Environment: Windows 10 (64-bit)
Avatar

I wanted to pass a null value to the RoundingDecimalPlace of the DoubleEditBox in ThemedDataGrid and wrote the following code, but the null is not set correctly.

<datagrid:ThemedDataGrid>
  <datagrid:ThemedDataGrid.Columns>
    <datagrideditors:DataGridDoubleColumn RoundingDecimalPlace="{x:Null}"/>
  </datagrid:ThemedDataGrid.Columns>
</datagrid:ThemedDataGrid>

Expected: RoundingDecimalPlace is null

Actual: RoundingDecimalPlace is 8

https://imgur.com/a/ZVeew6K

Steps to Reproduce:

  1. Create new WPF project
  2. Edit the code as follows

    *.csproj

    <Project Sdk="Microsoft.NET.Sdk">
      <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>net5.0-windows</TargetFramework>
        <Nullable>enable</Nullable>
        <UseWPF>true</UseWPF>
      </PropertyGroup>
    
      <ItemGroup>
        <PackageReference Include="ActiproSoftware.Controls.WPF.Editors.Interop.DataGrid" Version="21.1.3" />
        <PackageReference Include="ActiproSoftware.Controls.WPF.DataGrid.Contrib" Version="21.1.3" />
      </ItemGroup>
    </Project>
    

    MainWindow.xaml

    <Window x:Class="WpfApp31.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
            xmlns:datagrid="http://schemas.actiprosoftware.com/winfx/xaml/datagrid"
            xmlns:datagrideditors="http://schemas.actiprosoftware.com/winfx/xaml/datagrideditors"
            mc:Ignorable="d"
            Title="MainWindow" Height="450" Width="800">
        
        <datagrid:ThemedDataGrid AutoGenerateColumns="False" ItemsSource="{Binding}">
            <datagrid:ThemedDataGrid.Columns>
                <datagrideditors:DataGridDoubleColumn
                    Width="*"
                    Format="G"
                    Header="Value"
                    RoundingDecimalPlace="{x:Null}"
                    Binding="{Binding Value}"/>
            </datagrid:ThemedDataGrid.Columns>
        </datagrid:ThemedDataGrid>
    </Window>
    

    MainWindow.xaml.cs

    namespace WpfApp31
    {
        public partial class MainWindow : Window
        {
            public MainWindow()
            {
                InitializeComponent();
                this.DataContext = new Data[] { new(0), new(1) };
            }
        }
    
        public record Data(double Value);
    }
  3. Build and run

[Modified 3 months ago]

Comments (2)

Answer - Posted 3 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thanks for reporting this.  We found the bug with the RoundingDecimalPlace property value not propagating to the core edit box and fixed it for the next maintenance release.


Actipro Software Support

Posted 2 months ago by Yuki Ogawa
Avatar

Thank you for the investigation.
I look forward to your next release.

The latest build of this product (v22.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.