Highlighted
Outstanding Contributor.
Outstanding Contributor.
1798 views

Column sort ina a data grid

Jump to solution

Hello,

In dataGrid with numeric fields (e.g., customer code) when I SORT column is all sorted alphabetically, that is, the 161 appears after 1161 (for example).
Is there a way to order the same code?
Thanks
Alberto Ferraz
0 Likes
1 Solution

Accepted Solutions
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Column sort ina a data grid

Jump to solution

It's perfect. Thanks again.

Best Regards

Alberto Ferraz

View solution in original post

0 Likes
6 Replies
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Column sort ina a data grid

Jump to solution

Using WPF-Binding this works well. Remember PIC 9(4) is not a numeric value for .Net.

Can you show me your XAML and the property definition.

Freundliche Grüsse

Werner Lanter

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Column sort ina a data grid

Jump to solution

Hello,

The XAML definitions of CODIG field.

               <DataGridTextColumn Binding="{Binding CODIG, Mode=OneWay}" ClipboardContentBinding="{x:Null}" Header="Código" SortDirection="Descending" CanUserResize="False" FontSize="14" Width="60">

                   <DataGridTextColumn.HeaderStyle>

                       <Style>

                           <Setter Property="Control.HorizontalContentAlignment" Value="Center" />

                           <Setter Property="Control.Background" Value="Tan" />

                           <Setter Property="Control.Foreground" Value="Blue"/>

                           <Setter Property="Control.FontWeight" Value="Bold"/>

                       </Style>

                   </DataGridTextColumn.HeaderStyle>

                   <DataGridTextColumn.CellStyle>

                       <Style>

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

                       </Style>

                   </DataGridTextColumn.CellStyle>

               </DataGridTextColumn>

Best Regards

Alberto Ferraz

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Column sort ina a data grid

Jump to solution

Can you also show me the property definition of CODIG in the Cobol source.

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Column sort ina a data grid

Jump to solution

Definition on Cobol Source

Working Storage:

01 WRK-CODIG PIC 9(8).

Instruction to Binding

    set custCli::CODIG to WRK-CODIG

Definition on Class-Id.

      01 WRX-CODIG string property as "CODIG".

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Column sort ina a data grid

Jump to solution

Make the following chage:

Definition on Class-Id.

     01 WRX-CODIG binary-long property as "CODIG".

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: Column sort ina a data grid

Jump to solution

It's perfect. Thanks again.

Best Regards

Alberto Ferraz

View solution in original post

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.