Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do you make gridview controls disappear?

0 views
Skip to first unread message

COHEN...@lycos.com

unread,
Apr 29, 2008, 4:10:19 PM4/29/08
to
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

Nirosh

unread,
Apr 29, 2008, 4:37:37 PM4/29/08
to
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

--
L.W.C. Nirosh
<COHEN...@lycos.com> wrote in message
news:85e08a4a-1b67-49d2...@w7g2000hsa.googlegroups.com...

Eliyahu Goldin

unread,
Apr 30, 2008, 5:33:14 AM4/30/08
to
If you are using declarative databinding with DataSourceID, you need to run
select on the datasource to refresh the grid.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


<COHEN...@lycos.com> wrote in message
news:85e08a4a-1b67-49d2...@w7g2000hsa.googlegroups.com...

Arne Garvander

unread,
Apr 30, 2008, 10:24:02 AM4/30/08
to
Take them out to the parking lot and apply some dynamite.
--
Arne Garvander
Certified Geek
Professional Data Dude
0 new messages