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. modal window through datagrid hyperlink

modal window through datagrid hyperlink

Scheduled Pinned Locked Moved ASP.NET
javascripthtmlwpfwcfhelp
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.
  • N Offline
    N Offline
    Neeraj Arora
    wrote on last edited by
    #1

    Hi, my problem is I want to open a aspx page in modal window, when user clicks on datagrid's hyperlink column. I'm creating datagrid and its columns at run time, so I can not write binding command in html. Problem is, how I can pass reference of bounded column in place of parameter. This is the code: _DataGrid1.DataNavigateUrlFormatString = String.Format("javascript:window.showModalDialog(""NewPage.aspx?LicID={0}"")", "parameter") Thanks in advance. Neeraj

    M 1 Reply Last reply
    0
    • N Neeraj Arora

      Hi, my problem is I want to open a aspx page in modal window, when user clicks on datagrid's hyperlink column. I'm creating datagrid and its columns at run time, so I can not write binding command in html. Problem is, how I can pass reference of bounded column in place of parameter. This is the code: _DataGrid1.DataNavigateUrlFormatString = String.Format("javascript:window.showModalDialog(""NewPage.aspx?LicID={0}"")", "parameter") Thanks in advance. Neeraj

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      At runtime, you can dynamically build the hyperlink column like this:

      HyperLinkColumn col = new HyperLinkColumn();
      col.DataNavigateUrlField = "LicID";
      col.DataNavigateUrlFormatString = "javascript:window.showModalDialog('NewPage.aspx?LicID={0}')";

      N 1 Reply Last reply
      0
      • M minhpc_bk

        At runtime, you can dynamically build the hyperlink column like this:

        HyperLinkColumn col = new HyperLinkColumn();
        col.DataNavigateUrlField = "LicID";
        col.DataNavigateUrlFormatString = "javascript:window.showModalDialog('NewPage.aspx?LicID={0}')";

        N Offline
        N Offline
        Neeraj Arora
        wrote on last edited by
        #3

        Thanks for reply, but it takes "{0}" as parameter of ShowModalDialog. Neeraj

        M 1 Reply Last reply
        0
        • N Neeraj Arora

          Thanks for reply, but it takes "{0}" as parameter of ShowModalDialog. Neeraj

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          Do you specify the data field in the DataNavigateUrlField property of the HyperLink column? At data binding time, the data of the specified field is populated, then it is formatted using the format string. So you should not see the {0} which is supposed to be replaced by the value of the field bound to the row.

          N 1 Reply Last reply
          0
          • M minhpc_bk

            Do you specify the data field in the DataNavigateUrlField property of the HyperLink column? At data binding time, the data of the specified field is populated, then it is formatted using the format string. So you should not see the {0} which is supposed to be replaced by the value of the field bound to the row.

            N Offline
            N Offline
            Neeraj Arora
            wrote on last edited by
            #5

            Thanks, It is done. Now I'm passing {0} in parameter also which in turn picks the datafield. Neeraj

            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