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 - 29 Apr 2008 21:37 GMT
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

Signature
L.W.C. Nirosh
>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
[quoted text clipped - 14 lines]
> Thanks
> Marvin
Eliyahu Goldin - 30 Apr 2008 10:33 GMT
If you are using declarative databinding with DataSourceID, you need to run
select on the datasource to refresh the grid.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
>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
[quoted text clipped - 14 lines]
> Thanks
> Marvin
Arne Garvander - 30 Apr 2008 15:24 GMT
Take them out to the parking lot and apply some dynamite.

Signature
Arne Garvander
Certified Geek
Professional Data Dude
> 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
[quoted text clipped - 14 lines]
> Thanks
> Marvin