Yes or No about DataSources

G

Guest

hey all,
i have a multiview control that has 2 views in it. View1 has a gridview
bound to a SqlDataSource and View2 has a FormView bound to a SqlDataSource
also.

If, in the code, i don't set any views to be active does any binding still
occur in the background but it's just not visible?

thanks,
rodchar
 
S

Siva M

If the databinding happens unconditionally then both the gridviews will get
data bound even though the containing Views are not visible. In order to
avoid this handle the ActiveViewChanged event of the MultiView and bind only
the grid inside the active view.

hey all,
i have a multiview control that has 2 views in it. View1 has a gridview
bound to a SqlDataSource and View2 has a FormView bound to a SqlDataSource
also.

If, in the code, i don't set any views to be active does any binding still
occur in the background but it's just not visible?

thanks,
rodchar
 
G

Guest

when you say bind only in that event, so i have to go to the controls on the
designer and set the datasource to none and go into the go behind and in the
ActiveViewChanged do something like:
oFormView.DataSource=ObjectDataSource1
oFormView.DataBind()
 
S

Siva M

Bind the grid only when the View (part of MultiView control) containing the
grid is active.

when you say bind only in that event, so i have to go to the controls on the
designer and set the datasource to none and go into the go behind and in the
ActiveViewChanged do something like:
oFormView.DataSource=ObjectDataSource1
oFormView.DataBind()
 

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,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top