ASP.net 2.0 Gridview with Expanding Panel Rows -- How to build Panel "on the fly"

Posted by jlrolin on Stack Overflow See other posts from Stack Overflow or by jlrolin
Published on 2008-11-20T21:31:29Z Indexed on 2010/06/07 5:02 UTC
Read the original article Hit count: 531

I'm currently building a Gridview that has expandable rows. Each row contains a dynamically created Panel of Form elements. Right now, I have a javascript function that expands (or in my case, makes visible) the panel when an Image is clicked on the Gridview row.

My question is... is there a more efficient way of doing this. Instead of pulling all my data to begin with and building each new row as I Databind, is there a way to simple create the row with the Panel full of textboxes and dropdownlists on the fly when the user clicks the Expand button?"

I'd like to limit the server calls by doing it that way instead of how I'm currently doing it, looping through every row and creating a new panel with form elements and inserting that into a row that is hidden.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript