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

R

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
 
K

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.
 

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,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top