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. How to get control inside Datagrid ?

How to get control inside Datagrid ?

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

    I have a issue. I want to get the value of label control inside datagrid. I show my code

    <%#getCount()%>

    I want to get the value of "lblTen" control when I click image button "cmdMuc1". please people help me. Thanks a lot

    Richard DeemingR J 2 Replies Last reply
    0
    • N ngoloi

      I have a issue. I want to get the value of label control inside datagrid. I show my code

      <%#getCount()%>

      I want to get the value of "lblTen" control when I click image button "cmdMuc1". please people help me. Thanks a lot

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Assuming C#:

      protected void cmdMuc1(object sender, EventArgs e)
      {
      Control theButton = (Control)sender;
      Label theLabel = (Label)theButton.NamingContainer.FindControl("lblTen");
      string theValue = theLabel.Text;
      ...
      }


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      N 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        Assuming C#:

        protected void cmdMuc1(object sender, EventArgs e)
        {
        Control theButton = (Control)sender;
        Label theLabel = (Label)theButton.NamingContainer.FindControl("lblTen");
        string theValue = theLabel.Text;
        ...
        }


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        N Offline
        N Offline
        ngoloi
        wrote on last edited by
        #3

        thanks for your answer a lot

        1 Reply Last reply
        0
        • N ngoloi

          I have a issue. I want to get the value of label control inside datagrid. I show my code

          <%#getCount()%>

          I want to get the value of "lblTen" control when I click image button "cmdMuc1". please people help me. Thanks a lot

          J Offline
          J Offline
          J ved
          wrote on last edited by
          #4

          try this- Accessing the different controls inside a GridView control[^]

          ◘ "Everyone wants results, but no one is willing to do what it takes to get them" - Dirty Harry ◘ ► In Life go Straight, And turn Right ◄

          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