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. Grid button click event

Grid button click event

Scheduled Pinned Locked Moved ASP.NET
csstutorialquestion
5 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.
  • R Offline
    R Offline
    ravihd
    wrote on last edited by
    #1

    How to open modal web form on datagrid button click event??

    P 1 Reply Last reply
    0
    • R ravihd

      How to open modal web form on datagrid button click event??

      P Offline
      P Offline
      Prasad Babu A
      wrote on last edited by
      #2

      Hi, U need to write button code in DataGrid_ItemDataBound() event; In that event, 1st find that button and then write code like this. private void DataGrid_ItemDataBound() { Button btn = (Button)e.Item.FindControl("Button1"); btn.Attributes.Add("OnClick","window.open ('ss.aspx','sample');"); } I hope this will helps u. bye Pessi.

      R 1 Reply Last reply
      0
      • P Prasad Babu A

        Hi, U need to write button code in DataGrid_ItemDataBound() event; In that event, 1st find that button and then write code like this. private void DataGrid_ItemDataBound() { Button btn = (Button)e.Item.FindControl("Button1"); btn.Attributes.Add("OnClick","window.open ('ss.aspx','sample');"); } I hope this will helps u. bye Pessi.

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

        Nope its not working Private Sub wgQCLinked_ItemDataBound(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1ItemEventArgs) Handles wgQCLinked.ItemDataBound Dim btnRem As Button btnRem = e.FindControl("btnRemarks") btnRem.Attributes.Add("onclick", "window.showModalDialog('frmCustomerRemarks.aspx','BaseWork','dialogWidth:400px;dialogHeight:400px;center:no;');") End Sub btnRemaraks is bound column of datagrid Any guesssss

        P 1 Reply Last reply
        0
        • R ravihd

          Nope its not working Private Sub wgQCLinked_ItemDataBound(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1ItemEventArgs) Handles wgQCLinked.ItemDataBound Dim btnRem As Button btnRem = e.FindControl("btnRemarks") btnRem.Attributes.Add("onclick", "window.showModalDialog('frmCustomerRemarks.aspx','BaseWork','dialogWidth:400px;dialogHeight:400px;center:no;');") End Sub btnRemaraks is bound column of datagrid Any guesssss

          P Offline
          P Offline
          Prasad Babu A
          wrote on last edited by
          #4

          Hi, Try like this. btnRem.Attributes.Add("onclick", "window.showModalDialog('frmCustomerRemarks.aspx','BaseWork','dialogWidth:400px;dialogHeight:400px;center:no;');") bye Pessi.

          R 1 Reply Last reply
          0
          • P Prasad Babu A

            Hi, Try like this. btnRem.Attributes.Add("onclick", "window.showModalDialog('frmCustomerRemarks.aspx','BaseWork','dialogWidth:400px;dialogHeight:400px;center:no;');") bye Pessi.

            R Offline
            R Offline
            ravihd
            wrote on last edited by
            #5

            Nope

            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