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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Gridview with full-screen editing question

Gridview with full-screen editing question

Scheduled Pinned Locked Moved ASP.NET
questiondatabasecsharphtmlannouncement
3 Posts 2 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.
  • U Offline
    U Offline
    User 10410638
    wrote on last edited by
    #1

    I have a gridview control on my web page named gvItems. I have items and serial numbers defined on the gridview. I allow our customers to add serial numbers for their products. I use full-screen editing and I do not use the Edit / Update / Cancel link buttons. As you can see in my HTML below, I have a textbox named txtSerialNum. As I load the gridview rows from my SQL stored procedure, I have a column which tells me whether this item requires a serial number. If it does require a serial number, then I want to allow them to enter it like it is now. But if the item does not require a serial number, then I want to make the textbox enabled=false or readonly. How can I accomplish this? I assume I can use one of the gridview events but not sure which one. Here is my gridview code. I can post my C# code but the gridview is populated correctly already.

    M 1 Reply Last reply
    0
    • U User 10410638

      I have a gridview control on my web page named gvItems. I have items and serial numbers defined on the gridview. I allow our customers to add serial numbers for their products. I use full-screen editing and I do not use the Edit / Update / Cancel link buttons. As you can see in my HTML below, I have a textbox named txtSerialNum. As I load the gridview rows from my SQL stored procedure, I have a column which tells me whether this item requires a serial number. If it does require a serial number, then I want to allow them to enter it like it is now. But if the item does not require a serial number, then I want to make the textbox enabled=false or readonly. How can I accomplish this? I assume I can use one of the gridview events but not sure which one. Here is my gridview code. I can post my C# code but the gridview is populated correctly already.

      M Offline
      M Offline
      Mathi Mani
      wrote on last edited by
      #2

      The event you are looking for is RowDataBound. Add it to your gridview like this:

      And write your code in that event handler (gvItems_RowDataBound).

      U 1 Reply Last reply
      0
      • M Mathi Mani

        The event you are looking for is RowDataBound. Add it to your gridview like this:

        And write your code in that event handler (gvItems_RowDataBound).

        U Offline
        U Offline
        User 10410638
        wrote on last edited by
        #3

        Thanks! That worked perfectly.

        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