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 can i access Templated columns of datagrid in code behind

How can i access Templated columns of datagrid in code behind

Scheduled Pinned Locked Moved ASP.NET
helpcssquestion
2 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.
  • W Offline
    W Offline
    www Developerof NET
    wrote on last edited by
    #1

    Hi all, I have a problem with my datagrid. i have created three template columns in my datagrid but i cant access the column contents in code behind. I used Allot_Grid.SelectedItem.Cells[1].Text to access the first col of the grid but it returns null. Help!!!

    P 1 Reply Last reply
    0
    • W www Developerof NET

      Hi all, I have a problem with my datagrid. i have created three template columns in my datagrid but i cant access the column contents in code behind. I used Allot_Grid.SelectedItem.Cells[1].Text to access the first col of the grid but it returns null. Help!!!

      P Offline
      P Offline
      Pradipta Basu
      wrote on last edited by
      #2

      Hi use Allot_Grid.SelectedItem.FindControl("controlId") you must be using some control inside your TemplateColumn. The above code will give you the reference to the control as an object. You have to typecast it to the control and then use can use the properties of the control. Thanks,

      Pradipta Basu

      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