I am trying to format units per cell using XamDataGrid in Infragistics version 14.1 and I cannot find any examples.
This table is just an example of what I need to format.
The units can change depending on the Component.
The current code has the units in the column header but not all values have the same units.
<igDP:XamDataGrid Name="grid_Dose_Log" HorizontalAlignment="Left" Width="1090" Height="680" Canvas.Left="10" Canvas.Top="58" CellActivating="OnCellActivation"> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings RecordSelectorLocation="None" AllowAddNew="False" AllowDelete="False" AutoFitMode="Always" HighlightAlternateRecords="True" AllowFieldMoving="No"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:Field Name="Date" Width="150"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields" > <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamDateTimeEditor}"> <Setter Property="Mask" Value ="mm/dd/yyyy hh:mm"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="AllowDropDown" Value="False" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Bath" Width="80"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value ="{}{double:1.0}"/> <Setter Property="PromptChar" Value=""/> <Setter Property="SelectAllBehavior" Value="SelectEnteredCharacters" /> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="Value" Value="0"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Tank" Width="120"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields" > <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="IsReadOnly" Value="True" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Constituent" Width="200"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields" > <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamTextEditor}"> <Setter Property="HorizontalContentAlignment" Value="Center"/> <Setter Property="IsReadOnly" Value="True" /> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Requested" Width="100" Label="Requested (ml)"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value ="{}{double:8.1ml}"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Totalized" Width="100" Label="Totalized (ml)"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value ="{}{double:8.1}"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Time" Width="100" Label="Time (sec)"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value ="{}{double:8.1}"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Rate" Width="100" Label="Rate (ml/min)"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamNumericEditor}"> <Setter Property="Mask" Value ="{}{double:8.1}"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Auto" Width="60"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamCheckEditor}"> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> <igDP:Field Name="Error" Width="60"> <igDP:Field.Settings> <igDP:FieldSettings LabelTextAlignment="Center" LabelClickAction="SortByMultipleFields"> <igDP:FieldSettings.EditorStyle> <Style TargetType="{x:Type igEditors:XamCheckEditor}"> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </igDP:FieldSettings.EditorStyle> </igDP:FieldSettings> </igDP:Field.Settings> </igDP:Field> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
Hello Robert,
Thank you for posting. In order to achieve your requirement you will need a style of ‘ValueToDisplayTextConverter’.The ValueToDisplayTextConverter converter used for converting between display text and value.
I attached a small isolated sample for your reference.
Let me know if you have any question.
-Divya Jain
XDGValueToDisplayTextConvCase.zip