Home Forums WPF controls Xceed DataGrid for WPF percentage formating

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24940 |

    Hi,

    I used a convertrer in CellContentTemplate to convert a decimal coming from a table to a percentage. my problem is that when I hit the cell to edit I see the number as a decimal, I would like the user to enter 35 for 35% instead of entering 0.35.

    could somebody help?

    thanks

    Imported from legacy forums. Posted by dalia (had 579 views)

    Xceed Support
    Member
    Post count: 5658

    You can use the same converter in the CellEditor forthe column to have the editor display the value differently (CellEditorBinding has a converter parameter as well ).

    Imported from legacy forums. Posted by Marcus [Xceed] (had 257 views)

    User (Old forums)
    Member
    Post count: 23064

    here is my code but when I hit the cell it is not editable any more

    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <TextBlock Text=”{Binding Converter={StaticResource formatter}, ConverterParameter=’ \{0:P\}’}” />
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>

    Imported from legacy forums. Posted by dalia (had 372 views)

    User (Old forums)
    Member
    Post count: 23064

    Use TextBox instead.

    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <TextBox Content=”{Binding Converter={StaticResource formatter}, ConverterParameter=’ \{0:P\}’}” />
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>

    Imported from legacy forums. Posted by nat (had 505 views)

    User (Old forums)
    Member
    Post count: 23064

    thanks.

    Imported from legacy forums. Posted by dalia (had 4173 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.