ASP.NET Grid - Type Validation

PRODUCT ID
PRODUCT NAME
UNITS IN STOCK
UNITS ON ORDER
REORDER LEVEL
DISCONTINUED
EDIT
 
 
 
 
 
 
 
 
 
 
 
 
77
Original Frankfurter grüne Soße
32
0
15
False
76
Lakkalikööri
57
0
20
False
75
Rhönbräu Klosterbier
125
0
34
False
74
Longlife Tofu
3
20
1
True
73
Röd Kaviar
101
0
5
False
72
Mozzarella di Giovanni
14
0
0
False
71
Fløtemysost
26
0
0
False
70
Outback Lager
15
10
30
False
69
Gudbrandsdalsost
26
0
15
False
68
Scottish Longbreads
6
10
15
False
 
 
 
 
 
 
Records per page:
1
|
2
|
3
Records: 1 - 10 of 25 - Pages: 
-



To enable the Type Validation feature, just set EnableTypeValidation=true
When you Add/Edit records, the values you enter will be validated (they need to have the same type like in the database).
Also, the values will be checked against the MaxLength and AllowNulls properties of the columns in the database.

In this example, the "UNITS IN STOCK", "UNITS ON ORDER", "REORDER LEVEL" columns must be integers.
The "DISCONTINUED" column can have only the true/false values.
The "PRODUCT NAME" column has a maximum length of 40 characters, if this limit is exceeded, a message will pop-up.



« Back to examples