English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need to check during Editable mode of Datagrid that it should accept only numbers??????? how can i accomplish that....???

2006-09-26 08:22:50 · 2 answers · asked by hot_millions04 1 in Computers & Internet Programming & Design

2 answers

1. Make sure you have a validation function set up for updates in aspx page (mine is called DataUpdateCO):




2. Do validation by using ".FindControl" from the DataGridCommandEventArgs obj. My controls name is "CO_ID".


Sub DataUpdateCO(ByVal Sender As Object, ByVal E As DataGridCommandEventArgs)

Dim txtID As Integer = CInt(CType(E.Item.Cells(0).FindControl("CO_ID"), Label).Text)

If txtID = "" then
Msg.TExt = "Error the ID is empty!
'do not update the grids data and re-bind
Else
'update the drids data and re-bind
End IF

End Sub

2006-09-26 09:23:41 · answer #1 · answered by Ralph 7 · 0 0

Use regular expression validator control

2006-09-26 14:40:08 · answer #2 · answered by mel mel 2 · 0 0

fedest.com, questions and answers