The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi, I'm doing my own validation on various cells, and I can't get the focus to stay on the invalid cell if the user tabs out of that cell.
This is what I'm doing:
On OnCurrentCellEditingComplete, I do my validation on the current cell. When the cell data is invalid, I want to stay focused on that cell and ideally BeginEdit on the same cell again.
How can I do this?
ADAdministrator Syncfusion Team August 19, 2003 05:52 PM UTC
Instead of OnCurrentCellEditingComplete, use OnValidateCurrentCell instead. (Use CurrentCell.Renderer.ControlText to get the 'new' text value and do your validation on it.) If validation fails, set e.Cancel = true. You can also set CurrentCell.ErrorMessage if you want to display a message. Setting e.Cancel = true will force the currentcell to stay put.