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.
I have a GDBG where all cells are static except the one in AddNewRecord. This is achieved by using PrepareViewStyleInfo and having following code in handler:
private void _dataGrid_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { GridDataBoundGrid gdbg = sender as GridDataBoundGrid; if (e.RowIndex > gdbg.Model.Rows.HeaderCount) { if(e.ColIndex <= 0) return; if( gdbg[e.RowIndex, e.ColIndex] == null) return; // Make sure we are in Term column int termColIndex = gdbg.Binder.NameToColIndex("Term"); if(e.ColIndex == termColIndex) { if(gdbg.EnableAddNew && e.RowIndex == gdbg.Model.RowCount) { e.Style.CellType = "TextBox"; e.Style.ReadOnly = false; } else { e.Style.CellType = "Static"; e.Style.ReadOnly = true; } } } }
When I type info into the cell, if I hesitate between typing keys (for a couple of seconds) the value of the cell is lost. I then need to click on the new AddNewRecord for the record with the lost cell value to disappear and begin entering values again.
It seems strange that this only happens if there is some time between typing keys. (The focus on the cell doesn't seem to be lost while this occurs.)
The only other event I handle is CurrentCellAcceptedChanges, which does not get called.
Has anyone seen this type of behaviour before and know a workaround?
ADAdministrator Syncfusion Team October 27, 2006 01:03 PM UTC
If I change the code in PrepareViewStyleInto to set the appropriate column to TextBox then thhis doesn't occur...
However, I want all the cells in the grid to be Static except the AddNewRowRecord in this column, which should be TextBox so that the user can enter in values.