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
 
Ad

Advertisements

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()
 
Ad

Advertisements

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()
 

Top