473,395 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How do you make gridview controls disappear?

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
Jun 27 '08 #1
3 1450
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
<CO*********@lycos.comwrote in message
news:85**********************************@w7g2000h sa.googlegroups.com...
>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

Jun 27 '08 #2
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
<CO*********@lycos.comwrote in message
news:85**********************************@w7g2000h sa.googlegroups.com...
>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

Jun 27 '08 #3
Take them out to the parking lot and apply some dynamite.
--
Arne Garvander
Certified Geek
Professional Data Dude
"CO*********@lycos.com" wrote:
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
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
2
by: Flinky Wisty Pomm | last post by:
Hi all, I've got a really annoying problem that I need to fix sharpish. I've got a GridView derived control which has a templated header and footer. It works wonderfully on the first render but...
7
by: GaryDean | last post by:
I'm trying to load a GridView up with data manually, in code. I'm not using any datasource. Using this code.... ArrayList myRowArrayList; GridViewRow myGVR = new...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
2
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
2
by: ami | last post by:
In my code, I need to implement x numbers of Gridviews dynamically based on user selection. Because I am unaware of the number of gridviews, this is done after the user enters input. I need to...
3
by: Kurt Jakobsen | last post by:
Hello, Sorry for putting this problem back on the list. I had it previously under another title that now does not describe the real problem. Hopefully the new title will trigger someone that has had...
0
by: gnewsgroup | last post by:
Well, I am trying to use the footer row of a GridView for insertion purpose. There are some articles about this, for example, the gridviewguy.com has an example, which always displays the footer...
3
by: gnewsgroup | last post by:
I have a GridView which is bound to my database. The leftmost column of the GridView has a value of either 0 or 1, and I need to highlight the cell of column 3 if the leftmost column has a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.