[英]How can I programatically populate a WPF Grid in C# based on my database rows?
[英]How can I scroll the grid programatically in WPF?
我正在WPF
應用程序中從c#
代碼生成網格。 我的grid
是使用代碼動態生成的,並且包含許多行。 我想scroll the grid to some specific element
,以便用戶可以將特定元素視為網格中的第一條記錄。 您能幫助我們如何在WPF中以編程方式滾動網格嗎?
DataGrid.ScrollIntoView是否適合您? 第一個參數(項目)是要顯示的元素。
//
// Summary:
// Scrolls the System.Windows.Controls.DataGrid vertically and horizontally
// to display a cell for the specified data item and column.
//
// Parameters:
// item:
// The data item to bring into view.
//
// column:
// The column to bring into view.
public void ScrollIntoView(object item, DataGridColumn column);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.