0

As the title describes it basically, I want to add an unbound column that contains a value, which is calculated from two existing column values. Is there a simple way of doing it in XAML like an expression? So far I haven“t found anything close to my problem even though I think this is a pretty common use case.

Richard
  • 27
  • 6

2 Answers2

0

I dont think there is a simple xaml only way for this.

I can think of two possible solutions:

  • First is to use a Multibinding for your calculated column where the calcation happens in the Multibindin-Converter.
  • Second would be to add a Property to your backing DataClass representing your calculated value and let the calculation happen there and simply bind to that property.
huzle
  • 103
  • 1
  • 5
0

I think below solution ca be used. This will add custom column in datagrid.

<DataGridTemplateColumn>
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <TextBlock Width="100" Height="30" Text="You Value here" ></TextBlock>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>