Hello,
I'm having many issues trying to make the grid function properly for business applications (editing with return key, programmatic editing, etc.). I care not to delve into all of my issues here but I came across a related issue to this earlier where I can't programmatically focus on any cell that is out of view - that is, I found you basically have to scroll the row into view before you can begin edit? How can that be the design of the grid?
This has become frustrating for our team as if you look at the documentation for beginEdit() it just says:
The SfDataGrid allows to edit the cell programmatically by calling the SfDataGrid.BeginEdit method. By calling this method, the particular cell enters into edit mode. It edits the data manually or programmatically. To edit a cell programmatically, follow the code example:
this.dataGrid.Loaded += dataGrid_Loaded;
void dataGrid_Loaded(object sender, RoutedEventArgs e)
{
//Edit the cell at 2nd row,2nd column programmatically
this.dataGrid.BeginEdit(2, 2);
}
The above works if there is only a couple of rows but as soon as you have more than can fit in the grid, this line of code doesn't work for those rows? That seems so wrong.
Going further - a solution (workaround) has been provided here in this thread - basically showing you have to scroll first (not in docs) and use a delay (only in sample, not communicated). I took a look at the provided sample in hopes to find that there were more tricks involved that would fix my other editing and focusing issues...
Here is the proposed solution:
viewModel.OrdersInfo.Add(new OrderInfo() { OrderID = 1234, CustomerID = "1001", EmployeeID = 7654, FirstName = "Michael", LastName = "Irvine", ShipCity = "Boise", ShippingDate = DateTime.Now });
dataGrid.ScrollToRowIndex(dataGrid.View.Records.Count);
await Task.Delay(1000);
dataGrid.BeginEdit(dataGrid.View.Records.Count - 1, 2);
So in addition to the scrolling problem, the official recommendation from Syncfusion here is to have a 1 second delay? That is, to make the user wait an entire second before the cell is focused? That's completely unacceptable for my user base who are trying to enter data efficiently. And from the development side, why aren't we able to just invoke BeginEdit() in any case and have the grid handle it?
Is there any explanation that can be provided for why it is designed this way and any other information that may help me workaround these issues? I'm finding many scenarios where these magic second delay's are the only way to make it work and that doesn't seem right to me, I don't understand why the documentation doesn't show these requirements for usage.
Thank you,
Robert