Highlighted
Outstanding Contributor.
Outstanding Contributor.
1598 views

WPF Data Binding

I don’t get the correct format when binding a decimal value in a DataGrid Column with ConverterCulture=de-CH. I think that the resulting format is correct for Germany but not for Switzerland. Can anybody help?
0 Likes
3 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: WPF Data Binding

I did create a support incident 2793787.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: WPF Data Binding

I do as follows: Real currency (Brazil)

Decimal-point is comma.

01 wsPreco pic 9 (06) V99.

*> Datagridview column vrPreco / DefaultCellStyle / behavier format = C2

invoke self::dataGridView1::Rows::Add(... wsPreco)

Check also the regional system options

Hope this helps

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: WPF Data Binding

Of course I do this in XAML. Here the column Definition:

                   <DataGridTextColumn MinWidth="100"

                                       Binding="{Binding Path=EingBetrag, StringFormat=N02, ConverterCulture=de-CH, Mode=TwoWay}"

                                       Header= "Betrag">

                       <DataGridTextColumn.HeaderStyle>

                           <Style>

                               <Setter Property="Label.HorizontalContentAlignment" Value="Right" />

                           </Style>

                       </DataGridTextColumn.HeaderStyle>

                       <DataGridTextColumn.CellStyle>

                           <Style>

                               <Setter Property="TextBlock.TextAlignment" Value="Right" />

                           </Style>

                       </DataGridTextColumn.CellStyle>

                   </DataGridTextColumn>

I can convert with ::ToString("N02") and bind this field, but than a sort by this column gives a incorrect result.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.