当前位置:编程学习 > C#/ASP.NET >>

WPF中dxg:GridControl控件的GridColumn对象如何绑定对象的对象的字段


<dxg:GridControl AutoPopulateColumns="True" x:Name="gc01"   HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DockPanel.Dock="Bottom" Width="Auto" Height="Auto">
<dxg:GridControl.Columns>
<dxg:GridColumn x:Name="colID" FieldName="ID" MinWidth="50" Width="Auto" />
<dxg:GridColumn x:Name="col" FieldName="另一个对象的字段" MinWidth="60" Width="Auto"  />
</dxg:GridControl.Columns>
</dxg:GridControl>
--------------------编程问答--------------------

<dxg:GridColumn x:Name="colDataType" FieldName="FieldDataType" Header="Data Type" 
                            DisplayMemberBinding="{Binding Path=RowData.Row.FieldDataType.name, RelativeSource={RelativeSource Self} }" HorizontalHeaderContentAlignment="Center" 
                            BestFitMode="AllRows" BestFitArea="Rows" HorizontalAlignment="Right" Fixed="Right" FixedWidth="True"
                            MinWidth="100" />



用这个就行了RowData.Row
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,