Inserting from data in Gridview Footer fields RRS feed

  • Question

  • User-373571878 posted


    I am pulling data from textboxes in my Gridview footer.  Some of the fields should be numeric, but when I check for numeric even though there is a numeric value, the code kicks it out as a none numeric, probably because of the quotes surrounding the number like:  "12"

    How can I convert to numeric to check for numeric value?

    Input "12".  IsNumeric(newCPM) renders as False.

                Dim newCPM As TextBox = GridView1.FooterRow.FindControl("newCPM")
                If IsNumeric(newCPM) Then
                    Me.GridView1.Caption = "CPM must be Numeric!"
                    Me.GridView1.Caption = "<span style='color:Red;'>" & Me.GridView1.Caption & "</span>"
                    Exit Sub
                End If

    Wednesday, September 28, 2016 8:01 PM


  • User-373571878 posted

    I think I got it:


    Dim CPMNum = Convert.ToInt32(newCPM.Text)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 28, 2016 8:20 PM

All replies