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. General Programming
  3. .NET (Core and Framework)
  4. Image Button in Datagrid

Image Button in Datagrid

Scheduled Pinned Locked Moved .NET (Core and Framework)
tutorialquestion
5 Posts 4 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.
  • C Offline
    C Offline
    cb02061
    wrote on last edited by
    #1

    Hi, I already added an image button in Edit Item Template. I created calendar in Edit Item Template, i make it invisible. How to show calendar whenever image button clicked in datagrid???? Thanks, usha

    E S 2 Replies Last reply
    0
    • C cb02061

      Hi, I already added an image button in Edit Item Template. I created calendar in Edit Item Template, i make it invisible. How to show calendar whenever image button clicked in datagrid???? Thanks, usha

      E Offline
      E Offline
      ElSpinos
      wrote on last edited by
      #2

      A possibility: Investigate using AJAX and embed an UpdatePanel in the EditItemTemplate containing the calendar with it's visible property set to false. When the image click event is fired, set the calendar's visible property to true to show the calendar. Good luck...

      /F - .NET Developer

      C 1 Reply Last reply
      0
      • E ElSpinos

        A possibility: Investigate using AJAX and embed an UpdatePanel in the EditItemTemplate containing the calendar with it's visible property set to false. When the image click event is fired, set the calendar's visible property to true to show the calendar. Good luck...

        /F - .NET Developer

        C Offline
        C Offline
        cb02061
        wrote on last edited by
        #3

        Hi, Thanks for ur reply... Calendar drpDgTrType = (Calendar )Datagrid1.FindControl("drpDgTrType"); drpDgTrType.visible = true; However, i got Object reference not set to an instance of an object error when i run the codes. Please help... regards, usha

        B 1 Reply Last reply
        0
        • C cb02061

          Hi, Thanks for ur reply... Calendar drpDgTrType = (Calendar )Datagrid1.FindControl("drpDgTrType"); drpDgTrType.visible = true; However, i got Object reference not set to an instance of an object error when i run the codes. Please help... regards, usha

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

          On Row Create set the Command Arg to the row index. On the Command event of the gridview, set the command name of the Image button to ImgClicked or any thing you like. In the Method of the Command event.

          if (e.CommandName == "ImgClicked")
          {
          ((Calendar)GridView.Rows[e.CommandArgs].FindControl("drpDgTrType")).visible = true;
          }

          Well more or less. Hope it helps.

          1 Reply Last reply
          0
          • C cb02061

            Hi, I already added an image button in Edit Item Template. I created calendar in Edit Item Template, i make it invisible. How to show calendar whenever image button clicked in datagrid???? Thanks, usha

            S Offline
            S Offline
            SeaCrab
            wrote on last edited by
            #5

            Use the following code: Dim Cal As Calendar = CType(Dtgrd.Items(Dtgrd.EditItemIndex).FindControl("CalndrName"), Calendar) Cal.Visible = True

            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