Hi There,
I have XamDataGrid displaying list of objects. The issue I have is that double value is displayed only upto two decimal point. I would like to display double value as it is.
============================================================
<igDP:XamDataGrid x:Name="_dataGrid" GroupByAreaLocation="None" Theme="Aero"> <igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings AllowCellVirtualization="True" AllowEdit="False" CellClickAction="SelectRecord" LabelClickAction="SortByMultipleFieldsTriState" /> </igDP:XamDataGrid.FieldSettings> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False" AllowDelete="False" HighlightAlternateRecords="True" /> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="Symbol" Label="Symbol" Width="100"/> <igDP:Field Name="Exchange" Label="Exchange" Width="100"/> <igDP:Field Name="NumberOfFills" Label="NumberOfFills" Width="100"/> <igDP:Field Name="NumberOfOrders" Label="NumberOfOrders" Width="100"/> <igDP:Field Name="VolumeRatio" Label="VolumeRatio" Width="100"/> <igDP:Field Name="VolumeRatioLimit" Label="VolumeRatioLimit" Width="120"/> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts></igDP:XamDataGrid>
----------------------------
_dataGrid.DataSource = OrderEventCounts;
OrderEventCounts ---> ObservableCollection<OrderEventCount>;------------------------------public class OrderEventCount{ public string Symbol { get; set; } public string Exchange { get; set; } public int NumberOfFills { get; set; } public int NumberOfOrders { get; set; } public string VolumeRatio { get; set; } public double VolumeRatioLimit { get; set; }}
=======================================================
It displays VolumeRatioLimit (double) only up to 2 decimal points.
Please advise how can I display whole number.
Thanking you in advance for your help.
Thanks
Nasir
Hello Nasir,
You are very welcome. Thanks for choosing the Infragistics controls.
And again, sorry for the late reply. I'm glad that my answer was helpful for you.
Best regards,
Anastas
Hi Anastas,
Thanks for your help.
Regards,
Hello,
Sorry for the late reply.
I'm attaching a sample which demonstrates how to achieve this. Displaying a double values in xamDataGrid is handled by xamEditor controls. The default mask for double values is {double:10.2}, and that's why the decimal digits are always 2. In order to change this, xamEditor's mask should be changed - for example to {double:10.10}.
Can anyone help me in this.
Does Infragistics team has any answer for this?
Please advise.