From 42a042beb38bf8ec221216c698e6511630c0c2d4 Mon Sep 17 00:00:00 2001 From: Sunny Date: Mon, 21 Apr 2025 22:54:29 +0800 Subject: [PATCH] =?UTF-8?q?*=20UIDataGridView:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9B=B4=E6=96=B0=E6=97=B6=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=BB=9A=E5=8A=A8=E5=88=B0=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SunnyUI/Controls/UIDataGridView.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SunnyUI/Controls/UIDataGridView.cs b/SunnyUI/Controls/UIDataGridView.cs index c6f3439b..10533dc5 100644 --- a/SunnyUI/Controls/UIDataGridView.cs +++ b/SunnyUI/Controls/UIDataGridView.cs @@ -50,6 +50,7 @@ * 2024-06-19: V3.6.7 增加AddDateTimeColumn,解决默认时间列不显示秒数的问题 * 2024-08-27: V3.7.0 增加属性AutoScrollToBottom,数据更新时是否自动滚动到最后一行 * 2024-09-04: V3.7.0 解决有隐藏行时,滚动条滚动时出错的问题 + * 2025-04-21: V3.8.3 修复数据更新时是否自动滚动到最后一行 ******************************************************************************/ using System; @@ -1096,7 +1097,7 @@ namespace Sunny.UI //选中最后一行 this.Rows[this.RowCount - 1].Selected = true; //滚动到最后一行 - SetRowHeight(this.RowCount - 1); + this.FirstDisplayedScrollingRowIndex = this.RowCount - 1; //如果需要滚动到底部(右侧),使用下面的代码 //this.FirstDisplayedCell = this.Rows[this.RowCount - 1].Cells[this.Columns.Count - 1]; }