【发布时间】:2015-11-08 18:32:19
【问题描述】:
我遇到了一些关于 gridcontrol 的问题。
我必须使用填充、颜色、字体和悬停效果来设置网格列的样式和格式。
<Style x:Key="SelectedRowStyle" TargetType="{x:Type dxg:RowControl}">
<Setter Property="Foreground" Value="Black" />
<Setter Property="FontFamily" Value="pack://application:,,,/PA.Tos.UI;component/ResourceDictionaries/#Brandon Grotesque Black" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FontWeight" Value="Regular" />
<Style.Triggers>
<DataTrigger Binding="{Binding
ElementName=GroupCodeListView,Path=DataContext.SelectedGroupCode.Deleted,
UpdateSourceTrigger=PropertyChanged}" Value="true">
<Setter Property="Background" Value="Red" />
<Setter Property="Foreground" Value="Black" />
</DataTrigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource HoverRowBorderColor}" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
<Trigger Property="dxg:GridViewBase.IsFocusedRow" Value="True">
<Setter Property="Background" Value="{StaticResource HoverRowBorderColor}" />
<Setter Property="BorderBrush" Value="{StaticResource HoverStrokeColor}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Foreground" Value="Black" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="CustomCellStyle" BasedOn="{StaticResource {dxgt:GridRowThemeKey
ResourceKey=LightweightCellStyle}}" TargetType="{x:Type dxg:LightweightCellEditor}">
<Setter Property="MaxHeight" Value="25"/>
<Setter Property="MinHeight" Value="25"/>
<Style.Triggers>
</Style.Triggers>
为了响应鼠标悬停或行选择,我必须将所有网格线的边框设置为蓝色。只有底部的网格线是蓝色的 现在从上面。适用于 cellcontent Presenter 的代码在这里无法实现。
为了响应单击的垃圾桶图标,我必须为特定行显示浅红色背景。 我将(viewmodel 属性)SelectedGroupCode.Deleted=true 绑定到后台。绑定在代码中显示。 但除了有问题的行之外,所有行都被涂成红色。
必须设置网格线宽度。我已经设法仅使用 gridrowthemekey_rowcontrolcontainertemplate 将其设置为水平线。
我向您保证,我已经阅读了之前的一些帖子,但是对于 Scrum sprint 来说它花费了太多时间。
缺少什么?
【问题讨论】:
-
不清楚你是如何在
GridControl中使用这种风格的? -
我正在将行样式和单元格样式设置为上述样式。
标签: wpf devexpress gridcontrol