Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
745
number format column is not getting applied
posted

Hi,

I have this simple datatable with 2 string columns and rest of them are number columns of type Double.

I am trying to do a very simple thing, ie, format the number columns to be shown as with thousand separator comma. I have tried the following 3 lines (inside the for loop);

UltraGrid1.DisplayLayout.Bands(0).Columns(i).Format = "nnn,nnn,nnn,nnn.nn"
UltraGrid1.DisplayLayout.Bands(0).Columns(i).MaskInput = "nnn,nnn,nnn,nnn.nn"
UltraGrid1.DisplayLayout.Bands(0).Columns(i).MaskDisplayMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.IncludeLiterals

but above code has no effect on the format of the number columns.

I also wanted to set the horizontal text align of all number columns to be Right justified. For that I wrote the following line:

UltraGrid1.DisplayLayout.Bands(0).Columns(i).CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right

which did NOT work, so I wrote the following line:

UltraGrid1.DisplayLayout.Override.CellAppearance.TextHAlign = HAlign.Right

which DID work (but of course has also right-aligned the string columns which i dont want, plz suggest). Please tell me why the number format is not working what am i doing wrong, and also tell me why the first alignment statement didnt have any effect whereas the second statement for alignment worked, where as on your forums the first was supposed to work too.

waiting for reply, thanks.

PS: I am using ultrawingrid v8.1 in visual studio 2013 .Net 4, VB.

Parents
No Data
Reply
  • 1225
    Offline posted

    Hi Muhammad,
    The format you are providing is not the right one.
    This should work,
    UltraGrid1.DisplayLayout.Bands(0).Columns(i).Format = "###,###,###,###.##"

    Thanks,
    Josheela

Children
No Data