2012-01-30 103 views
-1

我有2個問題與轉換器在WPFWPF轉換問題

首先,取而代之的將轉換到我的unboundfield我想轉換器添加到二傳手值屬性如下

<Setter Property="Value" Value="{Binding FirstTransactionAllocationAmount, converter={StaticResource myconverter}" /> 

但它不起作用。

這裏是我的代碼示例

<igDP:XamDataGrid Name="gdWorksheetLine" Grid.Row="1" VerticalAlignment="Stretch" 
HorizontalAlignment="Stretch" 
            AutoFit="True" BindToSampleData="False" BorderThickness="2" 
           DataSource="{Binding Path=PaymentAdjustmentAllocation, Mode=TwoWay}"> 
        <igDP:XamDataGrid.FieldLayouts > 
         <igDP:FieldLayout IsDefault="True" Key="ClaimWorksheet"> 
          <igDP:FieldLayout.Fields> 
           <igDP:UnboundField Name="FirstTransactionAllocationAmount" Label="AmountKey" BindingPath="FirstTransactionAllocationAmount" 
                Converter="{StaticResource NegativeToPositiveValueConverter}" > 
            <igDP:Field.Settings> 
             <igDP:FieldSettings EditorType="{x:Type igEditors:XamCurrencyEditor}" LabelWidth="100" CellWidth="100" InvalidValueBehavior="RetainValue"> 
              <igDP:FieldSettings.EditorStyle> 
               <Style TargetType="{x:Type igEditors:XamCurrencyEditor}"> 
                <Setter Property="Mask" Value="$nn,nnn,nnn,nnn.nn" /> 
                <Setter Property="PromptChar" Value="" /> 
                <Setter Property="FlowDirection" Value="LeftToRight"/> 
                <Setter Property="Value" Value="FirstTransactionAllocationAmount" /> 
               </Style> 
              </igDP:FieldSettings.EditorStyle> 
             </igDP:FieldSettings> 
            </igDP:Field.Settings> 
           </igDP:UnboundField> 
          </igDP:FieldLayout> 
        </igDP:XamDataGrid.FieldLayouts> 
       </igDP:XamDataGrid> 

其次,我想創建一個使用另一個領域的DataGrid單元格值作爲參數,任何想法轉換器?

回答

1

如果你想使用另一個datagrid字段作爲參數,你需要使用MultiValueConverter

此外,「轉換器」應該是「轉換器」不知道,如果這是一個打字帶xaml到Stackoverflow或xaml中的錯誤。