【.Net6】【C1】【FlexGrid】表格线不显示
最后一行的表格线怎么让它显示呢?
默认的主题目前就是这样的,没法更改
你要是想要设置其他样式,建议用他这边其他的内置主题,可以参考开发包自带示例
下面找到
ComponentOne Samples\WPF\v6.0\CS\Grid\FlexGridExplorer
请上传一个示例项目上来重现问题,我不确定你现在边框不显示的原因是什么
Richard.Ma 发表于 2022-5-11 17:15
请上传一个示例项目上来重现问题,我不确定你现在边框不显示的原因是什么
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
using Prism.Commands;
namespace FlexGridDemo;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window {
private CheckBox _checkBoxAll;
private DelegateCommand<RoutedEventArgs> _onCheckedAllLoaded;
public MainWindow() {
InitializeComponent();
var elementItems = new ObservableCollection<ElementItem> {
new("A0", 1),
new("A1", 1),
new("A2", 1),
new("A3", 1),
new("A4", 1),
new("A5", 1)
};
ElementItems = elementItems;
FlexGridL1.ItemsSource = ElementItems;
}
public ObservableCollection<ElementItem> ElementItems { get; set; }
public class ElementItem {
public ElementItem(string elementName, double elementValue) {
ElementName = elementName;
ElementValue = elementValue;
}
public string ElementName { get; set; }
public double ElementValue { get; set; }
}
} <Window
Height="450"
Title="MainWindow"
Width="800"
mc:Ignorable="d"
x:Class="FlexGridDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Grid.Resources>
<Style TargetType="c1:FlexGrid" x:Key="Style">
<Setter Property="DefaultRowHeight" Value="Auto" />
<Setter Property="CellStyle">
<Setter.Value>
<Style TargetType="c1:GridCellView">
<Setter Property="Foreground" Value="#1C1C1C" />
<Setter Property="ToolTipService.InitialShowDelay" Value="1000" />
<Setter Property="ToolTipService.ToolTip" Value="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Content.Child .Text}" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="LightGray" />
</Trigger>
<Trigger Property="ToolTipService.ToolTip" Value="">
<Setter Property="ToolTip.IsEnabled" Value="False" />
</Trigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<c1:FlexGrid
AutoGenerateColumns="False"
BorderThickness="1,0,1,0"
ColumnHeaderGridLinesVisibility="All"
FrozenLinesBrush="Black"
FrozenRows="{Binding FrozenRows}"
Grid.Column="2"
GridLinesVisibility="All"
HeadersVisibility="Column"
IsReadOnly="True"
ItemsSource="{Binding ElementItems}"
MinWidth="200"
RowHeaderGridLinesVisibility="All"
SelectionMode="RowRange"
Style="{StaticResource Style}"
TopLeftHeaderGridLinesVisibility="All"
VerticalScrollBarVisibility="Auto"
Width="Auto"
x:Name="FlexGridL1">
<c1:FlexGrid.Columns>
<c1:GridColumn Header="元素" HeaderHorizontalAlignment="Center">
<c1:GridColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ElementName}" TextAlignment="Center" />
</DataTemplate>
</c1:GridColumn.CellTemplate>
</c1:GridColumn>
<c1:GridColumn Header="值" HeaderHorizontalAlignment="Center">
<c1:GridColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding ElementValue}" TextAlignment="Center" />
</DataTemplate>
</c1:GridColumn.CellTemplate>
</c1:GridColumn>
</c1:FlexGrid.Columns>
</c1:FlexGrid>
</Grid>
</Window>
Richard.Ma 发表于 2022-5-11 17:15
请上传一个示例项目上来重现问题,我不确定你现在边框不显示的原因是什么
无法上传文件,我把代码回复在评论里了
页:
[1]