Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. while updating in grid view

while updating in grid view

Scheduled Pinned Locked Moved ASP.NET
cssdesignhelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rajkumar 3
    wrote on last edited by
    #1

    Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Try Dim t As TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text Catch ex As Exception MsgBox(ex.Message) End Try End Sub i am getting error -- Object reference not set to an instance of an object.

    B 1 Reply Last reply
    0
    • R rajkumar 3

      Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating Try Dim t As TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text Catch ex As Exception MsgBox(ex.Message) End Try End Sub i am getting error -- Object reference not set to an instance of an object.

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Dim t As New TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text


      I Love T-SQL

      R J 2 Replies Last reply
      0
      • B Blue_Boy

        Dim t As New TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text


        I Love T-SQL

        R Offline
        R Offline
        rajkumar 3
        wrote on last edited by
        #3

        No change with that code also dude...

        B 1 Reply Last reply
        0
        • R rajkumar 3

          No change with that code also dude...

          B Offline
          B Offline
          Blue_Boy
          wrote on last edited by
          #4

          Check this result [^]hope it will help...


          I Love T-SQL

          R 1 Reply Last reply
          0
          • B Blue_Boy

            Check this result [^]hope it will help...


            I Love T-SQL

            R Offline
            R Offline
            rajkumar 3
            wrote on last edited by
            #5

            yah thanks i got it Dim reqno As String = (CType(GridView1.Rows(e.RowIndex).Cells(1).Controls(0), TextBox).Text)

            1 Reply Last reply
            0
            • B Blue_Boy

              Dim t As New TextBox t = CType(GridView1.Rows(e.RowIndex).FindControl("reqno"), TextBox) reqno = t.Text


              I Love T-SQL

              J Offline
              J Offline
              J4amieC
              wrote on last edited by
              #6

              very unhelpful answer. There is no need to create a new textbox and then assign the reference to an existing textbox.

              B 1 Reply Last reply
              0
              • J J4amieC

                very unhelpful answer. There is no need to create a new textbox and then assign the reference to an existing textbox.

                B Offline
                B Offline
                Blue_Boy
                wrote on last edited by
                #7

                Thanks for your opinion dude.


                I Love T-SQL

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups