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.
Hello,
I work with version 2.0 and use the GridControl class.
I would like to validate text during editing in a cell in a way that I don''t want to reject wrong input, but to diplay some error text in a separate textbox outside of the grid. I want to do this on each key which is pressed.
I do that now by the event CurrentCellValidateString and use the string of GridCurrentCellValidateStringEventArgs.Text
1.problem
the event is not called on Del-key pressed.
2.problem
the backspace-key inserts a character \b into the GridCurrentCellValidateStringEventArgs.Text, which is not in the resulting CellStyleinfo.Text
3.problem
during that event when I try to change the Text Color of the CurrentCell the focus jumps to the begining and the inserted character is inserted at the beginning and not where the focus was during typing the key.
thanks for help
ADAdministrator Syncfusion Team May 5, 2004 07:17 PM UTC
These are some problems we will try to address in a future release. (Do not know exactly what release will have these fixed.)
Here is a forum thread on similar questions and it has a sample trying to work-around such problems through some events.
http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=12073
To try to have the cursor in the same position before and after resetting the backcolor on an active cell will likely require that you save the textbox.SelectionStart and textbox.SelectionsLength before the change and restore them after the change. The sample in the above forum thread has similar code (for a different reason though).
TKThomas KratzerMay 5, 2004 10:14 PM UTC
Thanks for the quick answer. It works!!
I only had to use the GridTextBoxControl.TextChanged event of your example, because I don''t prevent the user of typing something wrong. I get the text there and I set the textcolor of GridControl.CurrentCell.. to red. I don''t have the focus jumping problem now without doing anything special about it.
Thanks again
Thomas