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. in bound column hyper link will be possible?

in bound column hyper link will be possible?

Scheduled Pinned Locked Moved ASP.NET
question
7 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.
  • M Offline
    M Offline
    Member 3879881
    wrote on last edited by
    #1

    Hi i am displaying some values in datagrid one boundcolumn, Like this: Ids: 1 2 3 4 5 Now in that paricular value only have to show in hyperlink, Ex: the 2 value have to show in hyperlink, its possible to show like that?, any one have idea abt this?,

    Thanks & Regards, Mageshh, please don't forget to vote on the post

    A 1 Reply Last reply
    0
    • M Member 3879881

      Hi i am displaying some values in datagrid one boundcolumn, Like this: Ids: 1 2 3 4 5 Now in that paricular value only have to show in hyperlink, Ex: the 2 value have to show in hyperlink, its possible to show like that?, any one have idea abt this?,

      Thanks & Regards, Mageshh, please don't forget to vote on the post

      A Offline
      A Offline
      Arun Jacob
      wrote on last edited by
      #2

      try this in RowDataBound event of grid. if (condition) { HyperLink hypLink = new HyperLink(); hypLink.Text = "Click Here"; hypLink.NavigateUrl = "Default.aspx"; e.Row.Cells[0].Controls.Add(hypLink); }

      Arun J

      M 1 Reply Last reply
      0
      • A Arun Jacob

        try this in RowDataBound event of grid. if (condition) { HyperLink hypLink = new HyperLink(); hypLink.Text = "Click Here"; hypLink.NavigateUrl = "Default.aspx"; e.Row.Cells[0].Controls.Add(hypLink); }

        Arun J

        M Offline
        M Offline
        Member 3879881
        wrote on last edited by
        #3

        Hi i am using vs2003, u given for vs2005, the same code will be work on item bound?

        Thanks & Regards, Mageshh, please don't forget to vote on the post

        E A 2 Replies Last reply
        0
        • M Member 3879881

          Hi i am using vs2003, u given for vs2005, the same code will be work on item bound?

          Thanks & Regards, Mageshh, please don't forget to vote on the post

          E Offline
          E Offline
          Elayaraja Sambasivam
          wrote on last edited by
          #4

          yes it will work.

          1 Reply Last reply
          0
          • M Member 3879881

            Hi i am using vs2003, u given for vs2005, the same code will be work on item bound?

            Thanks & Regards, Mageshh, please don't forget to vote on the post

            A Offline
            A Offline
            Arun Jacob
            wrote on last edited by
            #5

            Use it in Itembound and instead of row use Item

            Arun J

            M 1 Reply Last reply
            0
            • A Arun Jacob

              Use it in Itembound and instead of row use Item

              Arun J

              M Offline
              M Offline
              Member 3879881
              wrote on last edited by
              #6

              Hi i used itemcommand , but i am not getting link this is my code: Private Sub dglocal_itemdbound(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dglocal.ItemDataBound If e.Item.Cells(0).Text = "00:00" Then Dim hplink As HyperLink hplink.Text = e.Item.Cells(0).Text hplink.NavigateUrl = "frmTravelExpDetails.aspx" e.Item.Cells(0).Controls.Add(hplink) End If End Sub whats wrong in that?,

              Thanks & Regards, Mageshh, please don't forget to vote on the post

              A 1 Reply Last reply
              0
              • M Member 3879881

                Hi i used itemcommand , but i am not getting link this is my code: Private Sub dglocal_itemdbound(ByVal source As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dglocal.ItemDataBound If e.Item.Cells(0).Text = "00:00" Then Dim hplink As HyperLink hplink.Text = e.Item.Cells(0).Text hplink.NavigateUrl = "frmTravelExpDetails.aspx" e.Item.Cells(0).Controls.Add(hplink) End If End Sub whats wrong in that?,

                Thanks & Regards, Mageshh, please don't forget to vote on the post

                A Offline
                A Offline
                Arun Jacob
                wrote on last edited by
                #7

                Compare with this, protected void dGrid_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { HyperLink hypLink = new HyperLink(); hypLink.Text = e.Item.Cells[0].Text; hypLink.NavigateUrl = "Default.aspx"; e.Item.Cells[0].Controls.Add(hypLink); } }

                Arun J

                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