Last post Jan 15, 2019 09:42 AM by me_ritz
Jan 15, 2019 05:27 AM|shsu|LINK
I have grid view ,in which few cell are being validated using formulas.
For Each item As GridViewRow In kgrid.Rows
If item.RowType = DataControlRowType.DataRow Then
Dim label As Label = CType(item.FindControl("Label1"), Label)
Dim box As TextBox = CType(item.FindControl("TextBox1"), TextBox)
If box.Text > 0 Then
If boxa.Text = "" Or boxb.Text = "" Then
stdreq.Text = " Qty is required"
stdreq.Text = ""
My issue is ,there might be 10 rows in the grid view,if one line or last row only with condition If box.Text > 0 Then,then working fine ,but if first row shows " Qty is required" message,then next row will execute the else statement.I want it to be:
if any of the 10 lines have stdreq.Text = " Qty is required". it must stay until the last row validated. and if all rows executed with out stdreq.Text = " Qty is required" then I want to place kgrid.databind() How to be done. Thanks
Jan 15, 2019 05:54 AM|me_ritz|LINK
You can try RequiredFieldValidator...See below links...
Above code sample are using c#. You can always convert to VB http://converter.telerik.com/
Jan 15, 2019 06:08 AM|shsu|LINK
Not only null value ,some other formulas and comparison of another cell of the row ,also incorparated in some if condition. Hence,can not only use required field validation.
If there is only one row in grid view then every thing is working fine
Jan 15, 2019 09:42 AM|me_ritz|LINK
Follow this post https://forums.asp.net/t/1313007.aspx?CustomValidator+in+Gridview+itemtemplate+Server+Side+Validation+not+working