* UIDataGridView: 修复数据更新时是否自动滚动到最后一行

This commit is contained in:
Sunny 2025-04-21 22:54:29 +08:00
parent 123427892e
commit 42a042beb3

View File

@ -50,6 +50,7 @@
* 2024-06-19: V3.6.7 AddDateTimeColumn * 2024-06-19: V3.6.7 AddDateTimeColumn
* 2024-08-27: V3.7.0 AutoScrollToBottom * 2024-08-27: V3.7.0 AutoScrollToBottom
* 2024-09-04: V3.7.0 * 2024-09-04: V3.7.0
* 2025-04-21: V3.8.3
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -1096,7 +1097,7 @@ namespace Sunny.UI
//选中最后一行 //选中最后一行
this.Rows[this.RowCount - 1].Selected = true; 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]; //this.FirstDisplayedCell = this.Rows[this.RowCount - 1].Cells[this.Columns.Count - 1];
} }