Unplanned
Last Updated: 13 Mar 2025 12:08 by ADMIN
Volodymyr
Created on: 13 Mar 2025 12:03
Category: DataGrid
Type: Bug Report
1
DataGrid: Cell editor loses content when scrolled out of view and start editing another cell

Begin editing the first cell firs column
Without closing the cell editor, scroll down to the last cell, the first cell should exit the viewport.
Start editing the last cell.
Scroll back up to the first cell

The content inside the first cell is missing.

The content should be there.

1 comment
ADMIN
Didi
Posted on: 13 Mar 2025 12:08

Workaround: 

Get access to the DataGrid ScrollView and on Scrolled event you can execute the commit edit or cancel commit command

	public MainPage()
	{
		InitializeComponent();
		this.dataGrid.ItemsSource = GetSampleProducts();


		RadScrollView sv1 = FindRadScrollView(this.dataGrid);
		if (sv1 != null)
		{
			sv1.Scrolled += Sv_Scrolled;
		}
	}

	private void Sv_Scrolled(object? sender, ScrolledEventArgs e)
	{
		this.dataGrid.CommandService.ExecuteDefaultCommand(DataGridCommandId.CancelEdit, new EditContext(null, ActionTrigger.Programmatic, null));
		
	}

	private RadScrollView? FindRadScrollView(RadDataGrid grid)
	{
		foreach (var child in grid)
		{
			if (child is RadScrollView sv)
			{
				return sv;
			}
		}
		return null;
	}

Regards,
Didi
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!