How do you make gridview controls disappear?

C

COHENMARVIN

I have a gridview control that is filled by the user adding rows to it
with a submit button. Once he is totally through, I want to give him
a 'success' message and then empty the grid. That should be easy,
because the grid is full of records that are from a database where the
select statement retrieves by using a compare parameter that is a
session variable. In other words, something like this
Select * from MyTable Where FormID = @FormID
FormID is a session variable.
So simply setting the session variable to something impossible, like
-999, should clear the grids. But it doesn't. I tried doing a
gridview.databind statement after the -999, but that did not help
either.
Finally I tried making the gridviews invisible using their 'visible'
property - that also did not work!
Is there some bug here? Is the page not refreshing?
Can I force a page refresh?
Thanks
Marvin
 
N

Nirosh

It seems you have a hard coupled system here.. I don't think -999 will work

Anyway try to wrap the gridview with a div tag (run at server) and hide the
div, when post back, that should work for sure
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top