Home All Groups Group Topic Archive Search About

How can I prevent a GridView from opening when the page is firstentered ?

Author
11 Jan 2006 8:01 PM
Roberto Kohler
How can I prevent a GridView/SQLDataSource from opening when the page is
firstentered ?
I want to wait until the user clicks a button to open the sqlSataSource and
the grid.

I want to do something like:

If  Page.IsPostBack Then
     ' Open the sqlSataSource and the grid:
     ' - set the appropriate values for the SQLDataSource parameters
     ' - open the sqlSataSource
     ' - open the GridView1
else
    ' do not open the grid or the sqlSataSource
end if

Author
11 Jan 2006 8:10 PM
Keith Patrick
Set CancelSelectOnNullParameter="true" on the datasource, put in a dummy
null param, and programmatically remove it when you want to do a real
select.
Author
13 Jan 2006 3:11 PM
Roberto Kohler
That worked!  Thanks.