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. Header Problem in Gridview

Header Problem in Gridview

Scheduled Pinned Locked Moved ASP.NET
help
5 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.
  • S Offline
    S Offline
    Sneha Bisht
    wrote on last edited by
    #1

    Hi , Can i put Lable or Any Other Control in GridView's HeaderTemplate , i put control in HeaderTemplate and find this Control but its not working Code Label labname = (Lable)(GridView1.Rows[i].FindControl("ControlName")); now labname value show null with Error . The same Conditon works fine if i use Control in ItemTemplate . tell me the Solution .

    N 1 Reply Last reply
    0
    • S Sneha Bisht

      Hi , Can i put Lable or Any Other Control in GridView's HeaderTemplate , i put control in HeaderTemplate and find this Control but its not working Code Label labname = (Lable)(GridView1.Rows[i].FindControl("ControlName")); now labname value show null with Error . The same Conditon works fine if i use Control in ItemTemplate . tell me the Solution .

      N Offline
      N Offline
      nikhil1234
      wrote on last edited by
      #2

      You have to find that control after databinding and when dataitembound event gets fired in that you will get row if that rrow type is hederrow then you will get that control

      S 1 Reply Last reply
      0
      • N nikhil1234

        You have to find that control after databinding and when dataitembound event gets fired in that you will get row if that rrow type is hederrow then you will get that control

        S Offline
        S Offline
        Sneha Bisht
        wrote on last edited by
        #3

        Thanx 4 That , but can u tell me hw can i do this .

        V N 2 Replies Last reply
        0
        • S Sneha Bisht

          Thanx 4 That , but can u tell me hw can i do this .

          V Offline
          V Offline
          Vengatachalapathy Palanivel
          wrote on last edited by
          #4

          In which event, you are trying to find the control??

          Regards, Vengat P

          1 Reply Last reply
          0
          • S Sneha Bisht

            Thanx 4 That , but can u tell me hw can i do this .

            N Offline
            N Offline
            nikhil1234
            wrote on last edited by
            #5

            select grid control go to property page and in that event list will get rowdatabound event double click over there in that eent you will get e.row type chek that type and then finde your control if row type is header

            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