Unplanned
Last Updated: 28 Sep 2017 11:30 by ADMIN
ADMIN
Dilyan Traykov
Created on: 28 Sep 2017 11:23
Category: GridView
Type: Bug Report
0
GridView: Incorrect resizing of columns when unresizable columns are present
Currently, the following workaround can be applied:

private void RadGridView_Loaded(object sender, RoutedEventArgs e)
{
	var gridView = sender as RadGridView;
	foreach (var column in gridView.Columns)
	{
		if (!column.IsResizable)
		{
			Dispatcher.BeginInvoke((Action) (() =>
			{
				var radGridView = column.Parent;
				foreach (var header in radGridView.ChildrenOfType<GridViewHeaderCell>())
				{
					if (header.Column.DisplayIndex == column.DisplayIndex)
					{
						var leftGripper = header.ChildrenOfType<Thumb>().Where(x => x.Name == "PART_LeftHeaderGripper").First();
						{
							leftGripper.Visibility = Visibility.Collapsed;
						}
					}
					else if (header.Column.DisplayIndex == (column.DisplayIndex - 1))
					{
						var rightGripper = header.ChildrenOfType<Thumb>().Where(x => x.Name == "PART_RightHeaderGripper").First();
						{
							rightGripper.Visibility = Visibility.Collapsed;
						}
					}
				}
			}), DispatcherPriority.Render);
		}
	}
}
0 comments