Hi everybody,
Sub Validate_Data (Src As Object, Args As GridviewUpdaeEventArgs )

If Not IsNumeric(Args.NewValues("BookPrice")) Then
Args.Cancel = True
EditMSG.Text = "-- Book Price is not numeric. Record not updated." End If

How to write this if part in C#.

Please give the answer.

Thank you,
Aravind .

10 Years
Discussion Span
Last Post by abdul4484

Have you even tried? It looks like all your posts are just asking us to do work for you. Show some effort please.


errr... you should at least google it first, and then ask question once you tried it and didn't work XD

but basically you need to learn how to use class in C#, it's similar to Java :D


Hi guys,
Sorry actually I am beginner in .Net technologies.Thats why I am facing problems.Any how I found the solution .And here is the solution hoping it will be useful for someone.

Please give the alternatives if any

---Updating_Row(object sender, GridViewUpdateEventArgs e)
string str = e.NewValues["quantity"].ToString();
        double NUM;
        bool isNum = double.TryParse(str, out NUM);
        if (isNum==false)
            e.Cancel = true;
            EditMsg.Text = "-- Book Quantity is not numeric. Record not updated";


Thank you,

Edited by mike_2000_17: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.