We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Message Box caption

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

4 Replies

AD Administrator 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.


SA Sam July 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


AD Administrator Syncfusion Team July 26, 2004 07:32 PM UTC

The the Validatefailed handler, try also setting grid.CurrentCell.ErrorMessage = "".


SA Sam July 26, 2004 08:11 PM UTC

Great, it works. You just have to know the way. Silly me never thought of that.

Loader.
Live Chat Icon For mobile
Up arrow icon