Completed
Last Updated: 28 Jan 2022 09:28 by ADMIN
Release LIB 2022.1.131 (31 Jan 2022)
Martin Ivanov
Created on: 10 Jan 2022 12:30
Category: GridView
Type: Feature Request
0
GridView: New row is clipped when the BeginInsert method is used

Calling the BeginInsert() method of RadGridView, adds a new row at the bottom of the items and scrolls to the newly added row. However, if the vertical scrollbar is not visible and the newly added row makes the viewport so big that the scrollbar should display, the row gets clipped. Also, the vertical scrollbar that was just added is not scrolled to the bottom, which is actually why the row is clipped. Each next insert (after the scrollbar gets visible) will display the added row properly.

To work this around, you can scroll the vertical scrollbar manually to bottom. 

private void BeginInsertRow()
{
	var scrollViewer = this.gridView.FindChildByType<GridViewScrollViewer>();
	bool requestScrollToBottom = false;
	if (scrollViewer.ComputedVerticalScrollBarVisibility == Visibility.Collapsed)
	{
		var panel = this.gridView.FindChildByType<GridViewVirtualizingPanel>();
		var sumHeight = (source.Count + 1) * this.gridView.RowHeight;                
		requestScrollToBottom = sumHeight > panel.ActualHeight;                
	}
	this.gridView.BeginInsert();

	if (requestScrollToBottom)
	{
		scrollViewer.ScrollToBottom();
	}            
}

0 comments