Erez
Erez

Reputation: 6446

Telerik GridNumericColumn direction problem

I'm using a telerik RadGrid with direction RTL.

I have a telerik GridNumericColumn and the problem is that it shows numbers this way:

500-

instead of

-500

can someone give an advice ?

Upvotes: 0

Views: 725

Answers (1)

J.R.
J.R.

Reputation: 21

This is the default behavior of the browser. Bidirectional algorithm will swap the number and the sign. Check this out

<div dir="rtl">-5</div>

You can change this in the markup by using bdo element with ltr direction:

<div dir="rtl">
 <bdo dir="ltr">-5</bdo>
</div>

Since Telerik set the text for the column directly in the cell, it will be easier for you to set ItemStyle.CssClass and HorizontalAlign="Right". The css class will look something like this:

<style type="text/css">
    .myClass
    {
        direction:ltr;          
    }
</style>
<telerik:GridNumericColumn>
    <ItemStyle CssClass="myClass" HorizontalAlign="Right"/>
</telerik:GridNumericColumn>

I have used the technique above(with the css class) in few projects and it is working fine for me.

Interesting readings on that subject:

Upvotes: 1

Related Questions