XCeed DatagridのCellErrorStyleを変更するにはどうすればよいですか?
-
27-09-2019 - |
質問
したがって、XCehterドキュメントには、私にとっては機能しないコード例があります。グリッドがdatagridCollectionViewにバインドされているためかもしれません。 DatagridCollectionで使用されるコレクション内のオブジェクトは、IDATAERRORINFOを実装するものです。
エラーは問題なく表示されています。問題は、エラーにデフォルトのオレンジ色の背景を使用していることです...赤い境界線が必要です。以下は、グリッドのXAMLインスタンス化です。 Gridのプロパティにアクセスできると確信できるように、Datacell Backgroundプロパティを赤に設定しました...私はそうします。セルのエラーを識別する方法が見つかりませんので、スタイルをスタイリングできます。ありがとう!
<XceedDG:DataGridControl Grid.Row="1" Grid.ColumnSpan="5" ItemsSource="{Binding Path = ABGDataGridCollectionView, UpdateSourceTrigger=PropertyChanged}"
Background="{x:Static Views:DataGridControlBackgroundBrushes.ElementalBlue}" IsDeleteCommandEnabled="True"
FontSize="16" AutoCreateColumns="False" x:Name="EncounterDataGrid" AllowDrop="True">
<XceedDG:DataGridControl.View>
<Views:TableView ColumnStretchMode="All" ShowRowSelectorPane="True"
ColumnStretchMinWidth="100">
<Views:TableView.FixedHeaders>
<DataTemplate>
<XceedDG:InsertionRow Height="40"/>
</DataTemplate>
</Views:TableView.FixedHeaders>
</Views:TableView>
</XceedDG:DataGridControl.View>
<!--Group Header formatting-->
<XceedDG:DataGridControl.Resources>
<Style TargetType="{x:Type XceedDG:GroupByControl}">
<Setter Property="Visibility" Value="Collapsed"/>
</Style>
<Style TargetType="{x:Type XceedDG:DataCell}">
<Setter Property="Background" Value="Red"/>
</Style>
</XceedDG:DataGridControl.Resources>
...
解決
ナレッジベースエントリ:
http://xeched.com/kb/questions.php?questionid=256
重要な作品が欠けている可能性があるようです。
試してみましたか CellerrorStyleプロパティ datagridviewで?
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
<Grid.Resources>
<Style x:Key="errorStyle" TargetType="{x:Type xcdg:DataCell}">
<Setter Property="Foreground" Value="Red"/>
</Style>
</Grid.Resources>
<xcdg:DataGridControl CellErrorStyle="{StaticResource errorStyle}" >
<!--STUFF OMITTED-->
</xcdg:DataGridControl>
</xcdg:DataGridControl>
所属していません StackOverflow