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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to get Datalist ROW number?

How to get Datalist ROW number?

Scheduled Pinned Locked Moved ASP.NET
tutorialdatabasehelpquestion
3 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.
  • S Offline
    S Offline
    sameercodes
    wrote on last edited by
    #1

    I have a dropdown control in a datalist. Suppose there are 10 Rows in this datalist. If, for example, I select a value from the dropdown of the fifth row of the datalist, I need to get the ID or INDEX of that particular row of the datalist. Remeber, dropdown doesnot have CommandName property. Please help in achieving this.

    modified on Thursday, April 30, 2009 8:39 AM

    S 1 Reply Last reply
    0
    • S sameercodes

      I have a dropdown control in a datalist. Suppose there are 10 Rows in this datalist. If, for example, I select a value from the dropdown of the fifth row of the datalist, I need to get the ID or INDEX of that particular row of the datalist. Remeber, dropdown doesnot have CommandName property. Please help in achieving this.

      modified on Thursday, April 30, 2009 8:39 AM

      S Offline
      S Offline
      saanj
      wrote on last edited by
      #2

      What about storing the row no. in the value property of the drop-down list while binding. You can store the row no. as a comma seperated value. While getting just extract the value and use it.

      Either you love IT or leave IT...

      S 1 Reply Last reply
      0
      • S saanj

        What about storing the row no. in the value property of the drop-down list while binding. You can store the row no. as a comma seperated value. While getting just extract the value and use it.

        Either you love IT or leave IT...

        S Offline
        S Offline
        sameercodes
        wrote on last edited by
        #3

        Yeah, but even for that I need to have the row id of that datalist control. This is needed while using FindControl. ddlDropdown= (DropDownList)dlDataList.Items[dlRowNumber].FindControl("ddlLinkRefObjectType");

        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