<DataGridTextColumn Header="Total" Width="SizeToHeader" IsReadOnly="True">
<DataGridTextColumn.Binding>
<MultiBinding Converter="{StaticResource testname}">
<Binding Path="test1"/>
<Binding Path="test2"/>
</MultiBinding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
public class testnameConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
int dose = 0;
int waste = 0;
Int32.TryParse(values[0].ToString(), out dose);
Int32.TryParse(values[1].ToString(), out waste);
int total = dose + waste;
return total.ToString();
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotSupportedException();
}
}
我想知道如何将 DataGridTextColumn 转换为 telerik,因为 telerik 不支持telerik:GridViewDataColumn.Binding
. 有人可以告诉我如何使用我的转换器进行这项工作。