views:

493

answers:

2

Hi, I have a web application(ASP.NET2.0 C#) and in it, I have a gridview that gets its data from a datasource.

I wanted to add the following feature: the user can click a button "select columns", and a box pops up with a list of all the columns(a checkboxlist in a div, possibly) and that way, the user can choose the columns they want to see, and click another button "show" and the list of columns goes away, and the table shows the columns that the user selected.

I have already implemented the column choosing part, but it is the popup part that I need help with. How can I make the div popup and then disappear?

The solution might require javascript, and I might not have figured it out since I don't really know javascript that well.

Thank you.

A: 

Create the div and set visible=false. When you want to pop it up write the javascript to set it visible=true. here's a good pointer http://lists.evolt.org/archive/Week-of-Mon-20020624/116151.html

Dan Vallejo
+2  A: 

HI, Its better to make the display of div to be none rather than setting visibility to hidden. If visibility is set to hidden even if the div doesn't show up but it will take the rendering space which in some situation might not be that good.

You can dynamically create a div using createNode and then by absolute positioning and setting the top and left according to your convenience you can align the div to any portion in the page. Its better if you could disable the background when the div pops out.

rahul
I'm not very familiar with Javascript. Can you help me out?
zohair