473,397 Members | 1,972 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,397 software developers and data experts.

Yes or No about DataSources

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
Oct 11 '06 #1
3 1101
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.

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:CE**********************************@microsof t.com...
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

Oct 12 '06 #2
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()

"Siva M" wrote:
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.

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:CE**********************************@microsof t.com...
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

Oct 12 '06 #3
Bind the grid only when the View (part of MultiView control) containing the
grid is active.

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:6D**********************************@microsof t.com...
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()

"Siva M" wrote:
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.

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:CE**********************************@microsof t.com...
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

Oct 13 '06 #4

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

Similar topics

2
by: SammyBar | last post by:
Hi all, I have some custom collections (ArrayList of custom Objects) and I want to display them using typical Windows form controls (DataGrid, Combo). What should I do to expose them as valid...
0
by: Greg | last post by:
Anyone having issues with their object datasources appearing and vanishing from the datasource browser? I create an object for binding as a datasource in my App_Code folder, compile my web...
9
by: GaryDean | last post by:
We have been noticing that questions on vs.2005/2.0 don't appear to get much in answers so I'm reposting some questions posted by some of the programmers here in our organization that never got...
8
by: Joey Chömpff | last post by:
L.S., Hello is there a way to implement 2-way databinding without using the datasources from dotnet 2.0. Why would you ask? Now that's simple. I've created an object model with BusinessObjects...
0
by: Owen Richardson | last post by:
I have a page that displays a news article in a form view feeding off a datasource that just picks up the id from a query string. I want to add functionality for related links - so i created a...
1
by: Magnus | last post by:
I have a set of typed datasets that are tied to a database on a mssql2005 server. They are naturally displayed and available in the DataSources window. Now I want to rename the database, but when I...
3
by: jobs | last post by:
I've got a gridview that does not have a datasourceid assigned in the markup. I'd like to switch between two datasources in the codebehind. when I do switch, I first reset the the...
0
by: jobs | last post by:
Is there a correct way to change the datasourceId of a gridview in codebehind so that things like sorting, paging and deleting actually work? Or will have have to have one one to one...
19
by: cpnet | last post by:
I'm using VS2005, C#, ASP.NET 2.0. I'm trying to create a report using SQL Reporting Services (to be used in local mode so I don't have to deal with SQL Server). When I create a new report in my...
0
nev
by: nev | last post by:
i created a program with datasources which i added using the datasources wizard. my problem is the connectionstring server = localhost the program will be installed in 4 computers and the mysql...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.