![]() There is a single solution contained in the demo project included with this download. This solution is a C# Windows Forms application that contains a single form. On the form are eight different text boxes and each these text boxes are validated against a different set of criteria: The example is used to validate the contents of some text box controls. Naturally it is just as easy to validate other controls such as a combo box control although it most likely going to be used with text box controls. It is also possible to write a simple method to validate each of the fields in response to something like button click event. In the example provided, there is "Validate All" button that does test each of the controls on the form and mark any which contain invalid data. Normally one would write a custom validation method for each of the controls and test the control's content against that validation method whenever that specific control is validated. To use an error provider control, merely drop one from the toolbox onto the form you may use a single error provider control to mark any and all of the fields on a form, in this respect, using the error provider is similar to using the tool tip control. Once the control has been placed on the form, it may be controlled programmatically. You can display the error icon in the cell as well as a row header if needed.This article shall address the use of the error provider control in Win Forms application development. The error provider control is most useful in displaying errors associated with data entry tasks on a Windows form. The error provider control is typically used to show errors related to data entry, however, the developer may also use it to display any desired icon and accompanying tool tip in response to any monitored event. For example, successful entries could be shown with a green checkmark as easily as failed entries could be shown with the standard red ball exclamation mark. (See figures 1 and 2 where both good and bad entries are marked using the error provider control).įigure 1: Error Provider Control in Use Marking Bad Inputįigure 2: Using the Error Provider to Show Non-Failure Related Information To show the error icon in the row header, set ShowRowHeaderErrorIcon property to True. To show the error icon in the cell, set ShowErrorIcon property to True. You can show the error icon in the cell and row header using the ShowErrorIcon and the ShowRowHeaderErrorIcon properties respectively. You can show an error icon or error message box as an alert for incorrect data. \Syncfusion\EssentialStudio\Windows\Grid.Windows\Samples\Grid Layout\Error Provider Demo Enabling Error Alert \Syncfusion\EssentialStudio\Windows\\Samples\Styling and Formatting\Error Provider Demo ![]() \Syncfusion\EssentialStudio\Windows\GridDataBound.Windows\Samples\Appearance\Error Provider Demo Specifies the text to be displayed in the error message box.Ī sample of this feature is available in the following location: GridDataBoundGrid Specifies whether to show error message box. Specifies whether to show error icon in the row header. This feature is useful when you want to set only numeric values to be entered in a cell. This also enables you to specify the error conditions. This feature enables you to display an error icon in a specific cell and row header when incorrect data is entered in a cell. Built in Error Provider Support in Windows Forms GridDataBoundGridĮssential Grid for Windows Forms now provides a built-in error provider for error alerts.
0 Comments
Leave a Reply. |