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. Gridview template column having imagebutton

Gridview template column having imagebutton

Scheduled Pinned Locked Moved ASP.NET
helpcssannouncement
3 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.
  • D Offline
    D Offline
    d_smit
    wrote on last edited by
    #1

    hello ! I am using gridview to display records in my web application. I have defined two template column each having a asp imagebutton for delete row and update status respectively. for deleting row i am using grid rowdeleting event which is working fine but i am unable to get datakey column value on status imagebutton click. I also defined one bound column and on the basis of this boundcolumn and primary field column value i have to update status.I got stuck to this problem terribly. Anyone who knows please tell how on imagebutton click that particular row can be access.I want that particular row's primary key field(or datakey value as primary key column is assigned to this) and bound column value please send me the code or solution ASAP as its urgent. Any help will be highly appreaciated. Thanks in advance!!

    N H 2 Replies Last reply
    0
    • D d_smit

      hello ! I am using gridview to display records in my web application. I have defined two template column each having a asp imagebutton for delete row and update status respectively. for deleting row i am using grid rowdeleting event which is working fine but i am unable to get datakey column value on status imagebutton click. I also defined one bound column and on the basis of this boundcolumn and primary field column value i have to update status.I got stuck to this problem terribly. Anyone who knows please tell how on imagebutton click that particular row can be access.I want that particular row's primary key field(or datakey value as primary key column is assigned to this) and bound column value please send me the code or solution ASAP as its urgent. Any help will be highly appreaciated. Thanks in advance!!

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      d_smit wrote:

      please send me the code or solution ASAP as its urgent.

      Almost had me there until I saw this. Don't be rude and you might have gotten an answer. It may be urgent to you but not anyone else here.


      only two letters away from being an asset

      1 Reply Last reply
      0
      • D d_smit

        hello ! I am using gridview to display records in my web application. I have defined two template column each having a asp imagebutton for delete row and update status respectively. for deleting row i am using grid rowdeleting event which is working fine but i am unable to get datakey column value on status imagebutton click. I also defined one bound column and on the basis of this boundcolumn and primary field column value i have to update status.I got stuck to this problem terribly. Anyone who knows please tell how on imagebutton click that particular row can be access.I want that particular row's primary key field(or datakey value as primary key column is assigned to this) and bound column value please send me the code or solution ASAP as its urgent. Any help will be highly appreaciated. Thanks in advance!!

        H Offline
        H Offline
        Herman T Instance
        wrote on last edited by
        #3

        Well...the imagebutton is the sender ImageButton btn = (ImageButton)sender; the imagebutton is in the container of the row GridViewRow row = (GridViewRow)btn.NamingContainer; (you now can use the row.SelectedValue for your DataKey) The gridview row is in the container of the gridview GridView grd = (GridView)row.NamingContainer; ....use this answer quickly! cause it might be urgent! It is more polite not to tell in you question that it is urgent. Why you did not post your question when you did not run out of time!

        In Word you can only store 2 bytes. That is why I use Writer.

        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