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. populating a gridview in a Page_Load method

populating a gridview in a Page_Load method

Scheduled Pinned Locked Moved ASP.NET
helpdatabasequestion
5 Posts 4 Posters 2 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.
  • L Offline
    L Offline
    laziale
    wrote on last edited by
    #1

    Hi there! I have an issue and I hope I can get some advice how I can fix this. Here is my issue: I am creating a web site, and on one page, I have a gridview. I want the gridview to be populated from a code from the Page_Load method, actually a query according to the username, so I can retrieve the data what I need for the logged user and populate in the gridview. Is it possible to do that? I am using VS2005. Thx ahead, Laziale

    P C 2 Replies Last reply
    0
    • L laziale

      Hi there! I have an issue and I hope I can get some advice how I can fix this. Here is my issue: I am creating a web site, and on one page, I have a gridview. I want the gridview to be populated from a code from the Page_Load method, actually a query according to the username, so I can retrieve the data what I need for the logged user and populate in the gridview. Is it possible to do that? I am using VS2005. Thx ahead, Laziale

      P Offline
      P Offline
      Paddy Boyd
      wrote on last edited by
      #2

      Yes, of course you can do that - it's what most of the asp.net sites out there do. Have a look at some of the tutorials on www.asp.net[^], or www.4guysfromrolla.com[^].

      L 1 Reply Last reply
      0
      • P Paddy Boyd

        Yes, of course you can do that - it's what most of the asp.net sites out there do. Have a look at some of the tutorials on www.asp.net[^], or www.4guysfromrolla.com[^].

        L Offline
        L Offline
        laziale
        wrote on last edited by
        #3

        thx for the reply, I was trying to find some nice example, but without any success so far. Can you point to me some nice example or write few lines of code how it should be done? I will appreciate a lot, thx ahead, Laziale

        V 1 Reply Last reply
        0
        • L laziale

          thx for the reply, I was trying to find some nice example, but without any success so far. Can you point to me some nice example or write few lines of code how it should be done? I will appreciate a lot, thx ahead, Laziale

          V Offline
          V Offline
          Venkat Eswaran
          wrote on last edited by
          #4

          here you go http://msdn.microsoft.com/en-us/library/aa479339.aspx[^]

          Venky

          1 Reply Last reply
          0
          • L laziale

            Hi there! I have an issue and I hope I can get some advice how I can fix this. Here is my issue: I am creating a web site, and on one page, I have a gridview. I want the gridview to be populated from a code from the Page_Load method, actually a query according to the username, so I can retrieve the data what I need for the logged user and populate in the gridview. Is it possible to do that? I am using VS2005. Thx ahead, Laziale

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            One thing to consider. If you populate it in the page load, then any events that may fire, will fire after you populate it. The prerender event is generally the right place to put data into databound controls, it fires after button events.

            Christian Graus Driven to the arms of OSX by Vista.

            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