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?
ADAdministrator Syncfusion Team July 26, 2004 11:49 AM
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 01:52 PM
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;
e.Handled = true;
Thanks in advance,
ADAdministrator Syncfusion Team July 26, 2004 02:32 PM
The the Validatefailed handler, try also setting grid.CurrentCell.ErrorMessage = "".
SASamJuly 26, 2004 03:11 PM
Great, it works. You just have to know the way.
Silly me never thought of that.