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 the gridboundgrid inside a dialog mode form. One of the column inside the grid is of type double and only allow number between 0 and 100.
CellValueType = System.Double
ValidateValue.NumberRequired = True
ValidateValue.Minimum = 0
ValidateValue.Maximum = 100
ValidateValue.ErrorMessage = Must between 0 and 100
Everything is working nicely, except that the message shown in the message box does not have a caption/title. Is there any property that I can set for the message box title?
Thanks,
Sam
ADAdministrator Syncfusion Team July 26, 2004 04:49 PM UTC
No.
But you can handle the grid.ValidateFailed event, and there display your own MessageBox or Form or whatever. In the handler, you would want to set e.Handled = true to tell the grid you showed a dialog.
SASamJuly 26, 2004 06:52 PM UTC
Clay,
Thanks very much for the prompt reply.
I have tried to implement your solution. It works great if I move out from the grid after entering non-numeric data in the cell. But, if I move to another cell inside the grid afterwards, it show me the message twice, one from my own messagebox from the event handler and one from the grid itself.
The code that I use is as follow:
private void grid_ValidateFailed(object sender, Syncfusion.Windows.Forms.Grid.GridValidateFailedEventArgs e)
{
GridCurrentCell currentCell = grid.CurrentCell;
MessageBox.Show(currentCell.ErrorMessage, this.Text);
e.Handled = true;
}
Thanks in advance,
Sam
ADAdministrator Syncfusion Team July 26, 2004 07:32 PM UTC
The the Validatefailed handler, try also setting grid.CurrentCell.ErrorMessage = "".
SASamJuly 26, 2004 08:11 PM UTC
Great, it works. You just have to know the way.
Silly me never thought of that.