Professional Web Applications Themes

Datagrid invisible - ASP.NET Data Grid Control

Hi All, I have 2 datagrids which are generated in runtime based on values selected by user from a dropdown. I have a template column in the datagrid with checkboxes. I want the user to select some value in checkbox and based on that query the db to display some stuff. Now the problem is that if I set the checkboxes to AutoPostback = True, the datagrid disappears. I cant make them a part of the Page_Load event since they r based on the value from the dropdownlist. What can I do? Is there a ViewState property or something I ...

  1. #1

    Default Datagrid invisible

    Hi All,
    I have 2 datagrids which are generated in runtime based on values
    selected by user from a dropdown. I have a template column in the
    datagrid with checkboxes. I want the user to select some value in
    checkbox and based on that query the db to display some stuff. Now the
    problem is that if I set the checkboxes to AutoPostback = True, the
    datagrid disappears. I cant make them a part of the Page_Load event
    since they r based on the value from the dropdownlist.
    What can I do? Is there a ViewState property or something I can use?

    Please help. :(

    Thanks.
    DJ Dev Guest

  2. #2

    Default Re: Datagrid invisible

    Hello DJ,

    The item is actually stored in Viewstate, but it doesn't show up on the page
    since the control is built at runtime! I know it sounds like it won't work,
    but you want to go ahead and instantiate those datagrids in the page_load
    event even on a post back. If it's a postback, viewstate will take over from
    there and you'll have your fully populated datagrids just like you would if
    you had built the datagrids at design time. Make sure you don't initialize
    your datagrids, just instantiate and add to the controls collection.
    Initialization should only happen if it's not a postback. It's crazy, but it
    works!

    Corey O'Mara
    MCSD.NET, MCT

    "DJ Dev" <ricky.aroraicn.siemens.com> wrote in message
    news:1169423e.0402061536.2152ea27posting.google.c om...
    > Hi All,
    > I have 2 datagrids which are generated in runtime based on values
    > selected by user from a dropdown. I have a template column in the
    > datagrid with checkboxes. I want the user to select some value in
    > checkbox and based on that query the db to display some stuff. Now the
    > problem is that if I set the checkboxes to AutoPostback = True, the
    > datagrid disappears. I cant make them a part of the Page_Load event
    > since they r based on the value from the dropdownlist.
    > What can I do? Is there a ViewState property or something I can use?
    >
    > Please help. :(
    >
    > Thanks.

    Corey O'Mara Guest

Similar Threads

  1. I've got an invisible Status Bar??
    By west coaster in forum Macromedia Freehand
    Replies: 3
    Last Post: May 3rd, 06:17 AM
  2. Invisible page or something like this?
    By yevgen_78 in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 23rd, 03:39 PM
  3. Invisible Processes - Why?
    By Adahn in forum Windows Vista
    Replies: 27
    Last Post: March 15th, 01:15 PM
  4. Datagrid with rows and invisible text
    By pixart in forum Macromedia Flash Data Integration
    Replies: 5
    Last Post: July 4th, 07:49 AM
  5. Invisible lines
    By ardsley@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 8
    Last Post: May 14th, 07:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139