WebGrid has a client side built-in ability to validate masked data display.
In this topic, you will learn the basic thing on how to apply masked feature in WebGrid.
To set DateTime to a Column
- Open WebGrid.NET Designer.
- Go to Advanced.
- In the appropriate date column set DataType, for example: System.DateTime
- Set DataFormatString property, for example: MM/dd/yyyy.
- Set the EditType to CalendarDropDown or CalendarCombo.
- Click OK to apply the changes.
To set Currency to a Column
- Open WebGrid.NET Designer.
- Go to Advanced.
- In the appropriate date column set DataType, for example: System.Double.
- Set DataFormatString property, for example: $##,###.00.
- Set the AggregateFunction property, for example: Sum.
- Click OK to apply the changes.
To set Number Format to a Column
- Open WebGrid.NET Designer.
- Go to Advanced.
- In the appropriate date column set DataType, for example to System.Single.
- Set DataFormatString property, for example: #0.##%.
- Click OK to apply the changes.
References
DataFormatString Property
AggregateFunction Property
EditType Property
Other Resources
Walkthrough Topics
How-to Topics