Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bind to current row data in a column display template

In the devexpress grid below how do I bind to the current row data in the column template and use a converter object.

<dxg:GridControl ItemsSource="{Binding Data}" FontSize="16">
    <dxg:GridControl.View>
        <dxg:TableView AutoWidth="True" AllowEditing="False" AllowColumnMoving="False" NavigationStyle="None" ShowIndicator="False" AllowColumnFiltering="False" ShowGroupPanel="False" AllowPerPixelScrolling="True" AllowBestFit="True"/>
    </dxg:GridControl.View>
    <dxg:GridControl.Columns>
           
        <dxg:GridColumn Header="Field1" FieldName="Field1">
            <dxg:GridColumn.DisplayTemplate>
                <ControlTemplate>
    <!-- how do i bind to current row data-->
                </ControlTemplate>
            </dxg:GridColumn.DisplayTemplate>
        </dxg:GridColumn>
    </dxg:GridControl.Columns>
</dxg:GridControl>
like image 201
TrustyCoder Avatar asked Sep 19 '13 15:09

TrustyCoder


1 Answers

<ControlTemplate>
    <TextBlock Text="{Binding Path=RowData.Row.FieldName}">
    </TextBlock>
</ControlTemplate>
like image 85
TrustyCoder Avatar answered Oct 01 '22 18:10

TrustyCoder