Passing Gridview object from one page to another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinod allapu
    New Member
    • Apr 2009
    • 28

    Passing Gridview object from one page to another

    hi all,
    I have grid view in a page which is binded to a datasourse and it also contails itemtemplate fields with textboxes... now my requirement is i want to display this gridview in another page...

    iam able to display the gridview in another page if gridview contains no cotrols(itemFie lds). by putting datatable in session and using in another page.... but how to do it if the grid view contains controls(itemFi elds)... the way i did is having the gridview object in session...
    but my problem i couldnot able to make the gridview visible in another page(wich also contains the gridview)
    Can any one solve my problem by providing sample code

    for better underdstanding you can see the following gridview image in the attachment..

    Thanking You boss
    Attached Files
  • PRR
    Recognized Expert Contributor
    • Dec 2007
    • 750

    #2
    You will have to define the Gridview in the second page. And any controls that are required. You can then cache your datatable or you could use session...

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      You could also place your GridView into a WebUserControl so that you don't have to write the code for the same functionality twice. You can use this WebUserControl on any page that you require it to be displayed.

      It's not much different from what you're doing. You'd still have to cache the data source for the GridView in Session and continue doing exactly what you're currently doing in page 1. The only difference is that you'd move the GridView and any methods required by the GridView to function properly to a WebUserControl. Once you've done that you'd add an instance of the WebUserControl to the pages that you need to display the grid on (page 1 and 2).

      Comment

      • Srikanth Chippa
        New Member
        • May 2009
        • 4

        #4
        Using sesstion object you can pass Gridview object from one page to another page
        _______________ ___
        <removed advertisement links>
        Last edited by Frinavale; May 20 '09, 03:48 PM. Reason: removed advertisement links

        Comment

        Working...