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 know that this has been covered in these forums, but I have not been able to get it working right. All I want to do is prevent the "Input was not in correct format" messagebox from appearing at all when an invalid input is entered in a GC. My problem is that this message is appearing when users are entering blanks, which is not desirable for our application. I would rather catch this message and clear out the contents of the cell on invalid input with no message. Any help on this would be greatly appreciated. Thanks in advance.
ADAdministrator Syncfusion Team December 9, 2006 12:34 AM UTC
One way you can try to do this is to handle the CurrentCellErrorMessage event. You can cancel this event to avoid the error message displaying. You can also reset the current text if you want to. Here is some code snippets. private void Form1_Load(object sender, EventArgs e) { //make all cells doubles so errors are generated when you type something other than a double this.gridControl1.TableStyle.CellValueType = typeof(double);
gridControl1.CurrentCellErrorMessage += new GridCurrentCellErrorMessageEventHandler(grid_CurrentCellErrorMessage); }
How can I customize the tooltip message that is show? I want to add something like 'Press ESC' to cancel changes' for example to the message. Maybe even the column name!
ADAdministrator Syncfusion Team January 29, 2007 08:09 PM UTC
Hi James,
If you want to change the error tooltip text in a grid then you can hanlde the TableControlCurrentCellErrorMessage and set the custom error tooltip using CurrentRecordProperty.Exception property. Here is a code snippet to show this.
private void gridGroupingControl1_TableControlCurrentCellErrorMessage(object sender, GridTableControlCurrentCellErrorMessageEventArgs e) { GridGroupingControl grid = sender as GridGroupingControl; foreach(CurrentRecordProperty prop in grid.Table.CurrentRecordManager.Properties) { if( prop.IsError) prop.Exception = new Exception("Your ToolTip Message Here",prop.Exception.InnerException); } }