Hi!
I have a WPF datagrid in my program, which has an check box in it -
<DataGridTemplateColumn Header="Active?" Width="100" >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox x:Name="PP_ACTIVE" IsChecked="{Binding XPath=@active, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
I am reading data from a file that needs to set the check box if the field in the data is set to "X".
How do I do this? The SetAttributes command only works for String fields, and the CheckBox is a a Boolean field.
01 PAYPLAN_DG_XDOC type System.Xml.XmlDocument value new System.Xml.XmlDocument().
01 DG_ITEM type System.Xml.XmlElement.
SET DG_ITEM TO PAYPLAN_DG_XDOC::CreateElement("item").
MOVE SQ-UB41601-PAY-PLAN-MONTH TO D-PAY-PLAN-MONTH.
MOVE SQ-UB41601-PAY-PLAN-YEAR TO D-PAY-PLAN-YEAR.
INVOKE DG_ITEM::SetAttribute("month", D-PAY-PLAN-MONTH).
INVOKE DG_ITEM::SetAttribute("year", D-PAY-PLAN-YEAR).
IF SQ-UB41601-ACTIVE-FLAG = "X"
MOVE 1 TO WS-ACCEPT-VALUES
ELSE
MOVE 0 TO WS-ACCEPT-VALUES
END-IF.
MOVE SQ-UB41601-DUE-AMT TO D-PAY-PLAN-AMT-DUE.
ADD SQ-UB41601-DUE-AMT TO W-PAY-PLAN-BALANCE.
INVOKE DG_ITEM::SetAttribute("due", D-PAY-PLAN-AMT-DUE).
MOVE SQ-UB41601-AMT-PAID TO D-PAY-PLAN-AMT-PAID.
ADD SQ-UB41601-AMT-PAID TO W-PAY-PLAN-PAID-BALANCE.
INVOKE DG_ITEM::SetAttribute("paid", D-PAY-PLAN-AMT-PAID).
INVOKE PAYPLAN_DG_XDOC::DocumentElement::AppendChild(DG_ITEM).