DEV控件中的Grid控件,当其中有数据时,在最左侧的列指示器显示行号。便于查阅。
1、前台增加控件
开关增加控件引用空间
xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
<dxg:GridControl Name="grid" AutoGenerateColumns="AddNew">
<dxg:GridControl.View>
<dxg:TableView RowIndicatorContentTemplate="{StaticResource rowIndicatorContentTemplate}"/>
</dxg:GridControl.View>
</dxg:GridControl>
2.定义模板资源
<UserControl.Resources>
<DataTemplate x:Key="rowIndicatorContentTemplate">
<StackPanel VerticalAlignment="Stretch"
HorizontalAlignment="Stretch">
<TextBlock Text="{Binding Path=RowHandle.Value}"
TextAlignment="Center"
Foreground="Gray"/>
</StackPanel>
</DataTemplate>
</UserControl.Resources>