From 82355a3cda82fb26334449fc6087d56feb78365c Mon Sep 17 00:00:00 2001 From: Sunny Date: Mon, 2 May 2022 16:54:07 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIDataGridView=EF=BC=9A=20ShowGridLine?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIDataGridView.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SunnyUI/Controls/UIDataGridView.cs b/SunnyUI/Controls/UIDataGridView.cs index d6820db0..5a58996c 100644 --- a/SunnyUI/Controls/UIDataGridView.cs +++ b/SunnyUI/Controls/UIDataGridView.cs @@ -638,8 +638,9 @@ namespace Sunny.UI get => CellBorderStyle == DataGridViewCellBorderStyle.Single; set { - CellBorderStyle = value ? DataGridViewCellBorderStyle.Single : DataGridViewCellBorderStyle.None; - VBar.ShowLeftLine = value; + if (value && CellBorderStyle != DataGridViewCellBorderStyle.Single) + CellBorderStyle = DataGridViewCellBorderStyle.Single; + VBar.ShowLeftLine = CellBorderStyle == DataGridViewCellBorderStyle.Single; } }