473,811 Members | 3,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

In trouble.....

Well as some of you know I was using a tab control for a project I was
building for my boss.

Today he tells me that he wants:

When he switches tabs to be able to switch back and see whatever it was he
was doing on the other tab.

That may not sound like a big thing but I used the same controls for each
tab and then manually cleared the page so he didnt see the same in another
page. (datasource cleared out etc)

This is what I did:

If TabControl1.Sel ectedIndex = 2 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.Sel ectedIndex = 1 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them with new values
End If

I have to clear it on their arrival other wise they will see the data from
the other page, right?

Is there any way I can retain what they did without being forced to create
different controls on each tab page?

Nov 20 '05 #1
16 1371
Scorpion,

What is the big deal with having two more grids or you could cache the
datasource

Dan
"scorpion53 061" <sc************ *************** *@yahoo.com> wrote in message
news:u6******** ******@tk2msftn gp13.phx.gbl...
Well as some of you know I was using a tab control for a project I was
building for my boss.

Today he tells me that he wants:

When he switches tabs to be able to switch back and see whatever it was he
was doing on the other tab.

That may not sound like a big thing but I used the same controls for each
tab and then manually cleared the page so he didnt see the same in another
page. (datasource cleared out etc)

This is what I did:

If TabControl1.Sel ectedIndex = 2 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.Sel ectedIndex = 1 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them with new values
End If

I have to clear it on their arrival other wise they will see the data from
the other page, right?

Is there any way I can retain what they did without being forced to create
different controls on each tab page?

Nov 20 '05 #2
if i recall corectly he's talking about a lot of tabpages
i do have a suggestion let us know how it turns out
create a class that holds all the data of 1 tabpage and an integer to tell w
tabpage we are talking about (even better put them in an array, creating
class arrays has been talked about a while back)
it could have some datasets, strings, ...
put the code to manipulate the data in the class
when the user selects a tabpage populate it from the class, if it's a new
one it would be blank or you get it from the db, if it's already filled in
populate it from the class.

hope it helps

eric

"solex" <so***@nowhere. com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
Scorpion,

What is the big deal with having two more grids or you could cache the
datasource

Dan
"scorpion53 061" <sc************ *************** *@yahoo.com> wrote in message news:u6******** ******@tk2msftn gp13.phx.gbl...
Well as some of you know I was using a tab control for a project I was
building for my boss.

Today he tells me that he wants:

When he switches tabs to be able to switch back and see whatever it was he was doing on the other tab.

That may not sound like a big thing but I used the same controls for each tab and then manually cleared the page so he didnt see the same in another page. (datasource cleared out etc)

This is what I did:

If TabControl1.Sel ectedIndex = 2 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.Sel ectedIndex = 1 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them with new values
End If

I have to clear it on their arrival other wise they will see the data from the other page, right?

Is there any way I can retain what they did without being forced to create different controls on each tab page?


Nov 20 '05 #3
Cor
Hi Eric,

I was thinking about that solution you told also, but than I did look to the
answer/question from Solex and thought, yes Solex is right, why would
Scorpion just use one datagrid, while more will maybe fix his problem very
simple.

What are your arguments not doing that, I really was in doubt if I would
give the same answer as you?

Cor
if i recall corectly he's talking about a lot of tabpages
i do have a suggestion let us know how it turns out
create a class that holds all the data of 1 tabpage and an integer to tell w tabpage we are talking about (even better put them in an array, creating
class arrays has been talked about a while back)
it could have some datasets, strings, ...
put the code to manipulate the data in the class
when the user selects a tabpage populate it from the class, if it's a new
one it would be blank or you get it from the db, if it's already filled in
populate it from the class.

Nov 20 '05 #4
if i'm not mistaking he has 28 tabpages that use this (again if im not
mistaking there could be more in the future)
i thought he wanted something that would work for 3, 10, 28,100, ...
tabpages and do'nt give to much work for an additional page.

imagine if you have to change something in your code, do you want to do it
once or a 100 times?

an alternative would be creating a control array, but since he seems to have
something working now it seemed bether to expand on that.

eric

"Cor" <no*@non.com> wrote in message
news:O0******** ******@TK2MSFTN GP09.phx.gbl...
Hi Eric,

I was thinking about that solution you told also, but than I did look to the answer/question from Solex and thought, yes Solex is right, why would
Scorpion just use one datagrid, while more will maybe fix his problem very
simple.

What are your arguments not doing that, I really was in doubt if I would
give the same answer as you?

Cor
if i recall corectly he's talking about a lot of tabpages
i do have a suggestion let us know how it turns out
create a class that holds all the data of 1 tabpage and an integer to tell
w
tabpage we are talking about (even better put them in an array, creating
class arrays has been talked about a while back)
it could have some datasets, strings, ...
put the code to manipulate the data in the class
when the user selects a tabpage populate it from the class, if it's a

new one it would be blank or you get it from the db, if it's already filled in populate it from the class.


Nov 20 '05 #5
Cor
Hi EricJ,

I understand now, but thinking on it I think I would do it by making a user
control and put that in an array then ( I never did, but I would try it
first if it was my problem)

:-)

Thanks,

Cor
if i'm not mistaking he has 28 tabpages that use this (again if im not
mistaking there could be more in the future)
i thought he wanted something that would work for 3, 10, 28,100, ...
tabpages and do'nt give to much work for an additional page.

imagine if you have to change something in your code, do you want to do it
once or a 100 times?

an alternative would be creating a control array, but since he seems to have something working now it seemed bether to expand on that.

Nov 20 '05 #6
Hi eric you are correct. This had 28 tab pages.

The only way I could see this working was to make duplicate controls for all
the tab pages.

Now on your suggestion you I am sorry to ask this but would you take a
control such as a datagrid (I also have to do this with several other types
of controls) and show me how you would do this? Just enough to help get me
started on what you are describing.
"EricJ" <ericRéMo**@Thi Somnipack.be> wrote in message
news:3f******** *************@r eader5.news.sky net.be...
if i'm not mistaking he has 28 tabpages that use this (again if im not
mistaking there could be more in the future)
i thought he wanted something that would work for 3, 10, 28,100, ...
tabpages and do'nt give to much work for an additional page.

imagine if you have to change something in your code, do you want to do it
once or a 100 times?

an alternative would be creating a control array, but since he seems to have something working now it seemed bether to expand on that.

eric

"Cor" <no*@non.com> wrote in message
news:O0******** ******@TK2MSFTN GP09.phx.gbl...
Hi Eric,

I was thinking about that solution you told also, but than I did look to the
answer/question from Solex and thought, yes Solex is right, why would
Scorpion just use one datagrid, while more will maybe fix his problem very
simple.

What are your arguments not doing that, I really was in doubt if I would
give the same answer as you?

Cor
if i recall corectly he's talking about a lot of tabpages
i do have a suggestion let us know how it turns out
create a class that holds all the data of 1 tabpage and an integer to

tell
w
tabpage we are talking about (even better put them in an array, creating class arrays has been talked about a while back)
it could have some datasets, strings, ...
put the code to manipulate the data in the class
when the user selects a tabpage populate it from the class, if it's a

new one it would be blank or you get it from the db, if it's already
filled in populate it from the class.



Nov 20 '05 #7
I have something that worked here........it is so simple I may not be
thinking of someting but here goes.....

I declared at the module level 28 different dataviews - one for each tab
page datagrid.

When the user selects that tab page it binds to that view.

The data is there when it is supposed to be and not there when it is not
supposed ot be. It also retained the formatting I call for in code. The only
downside is when there were zero rows it showed a datagrid with one square
in teh left hand corner for the grid but I think I can get away with that.

My concern is obviously what effect 28 dataviews will have on the users
resources, and down the road when I need to update the views when the user
is not looking at the tab page if it will be difficult to do.

I assume adding or removing a row from a view is not that hard. At least I
hope.

What do you guys think?
"EricJ" <ericRéMo**@Thi Somnipack.be> wrote in message
news:3f******** **************@ reader1.news.sk ynet.be...
if i recall corectly he's talking about a lot of tabpages
i do have a suggestion let us know how it turns out
create a class that holds all the data of 1 tabpage and an integer to tell w tabpage we are talking about (even better put them in an array, creating
class arrays has been talked about a while back)
it could have some datasets, strings, ...
put the code to manipulate the data in the class
when the user selects a tabpage populate it from the class, if it's a new
one it would be blank or you get it from the db, if it's already filled in
populate it from the class.

hope it helps

eric

"solex" <so***@nowhere. com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
Scorpion,

What is the big deal with having two more grids or you could cache the
datasource

Dan
"scorpion53 061" <sc************ *************** *@yahoo.com> wrote in message
news:u6******** ******@tk2msftn gp13.phx.gbl...
Well as some of you know I was using a tab control for a project I was
building for my boss.

Today he tells me that he wants:

When he switches tabs to be able to switch back and see whatever it
was he was doing on the other tab.

That may not sound like a big thing but I used the same controls for each tab and then manually cleared the page so he didnt see the same in another page. (datasource cleared out etc)

This is what I did:

If TabControl1.Sel ectedIndex = 2 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.Sel ectedIndex = 1 Then
DataGrid1.DataS ource = Nothing
DataGrid2.DataS ource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them with new values
End If

I have to clear it on their arrival other wise they will see the data from the other page, right?

Is there any way I can retain what they did without being forced to create different controls on each tab page?



Nov 20 '05 #8
this is roughly w i had in mind (ok you will still have a lot of dataviews
but i doubt that will be a problem, its a lot better then accessing the db
all the time).
use the property's of the class in your application
\\
'first a class
Public Class test
Private dv As DataView
Private str1, str2 As String
Public Sub New()
dv = New DataView
str1 = ""
str2 = ""
End Sub
Public Sub New(ByVal dview As DataView, ByVal string1 As String, ByVal
string2 As String)
dv = dview
str1 = string1
str2 = string2
End Sub
Public Property dView() As DataView
Get
Return dv
End Get
Set(ByVal Value As DataView)
dv = Value
End Set
End Property
Public Property String1() As String
Get
Return str1
End Get
Set(ByVal Value As String)
str1 = Value
End Set
End Property
'...
Public Sub load()
'load the data from your db here
End Sub
Public Sub save()
'save the data in the db here
End Sub
'...
End Class
//

in your app create an array of the class

\\
private arrtest(28) as test
//

when you use it for the first time

\\
arrtest(i) = new test
'i would be the index of the tab page
//

then fill the controls w the class

"scorpion53 061" <sc************ *************** *@yahoo.com> wrote in message
news:uE******** ******@TK2MSFTN GP11.phx.gbl...
Hi eric you are correct. This had 28 tab pages.

The only way I could see this working was to make duplicate controls for all the tab pages.

Now on your suggestion you I am sorry to ask this but would you take a
control such as a datagrid (I also have to do this with several other types of controls) and show me how you would do this? Just enough to help get me
started on what you are describing.
"EricJ" <ericRéMo**@Thi Somnipack.be> wrote in message
news:3f******** *************@r eader5.news.sky net.be...
if i'm not mistaking he has 28 tabpages that use this (again if im not
mistaking there could be more in the future)
i thought he wanted something that would work for 3, 10, 28,100, ...
tabpages and do'nt give to much work for an additional page.

imagine if you have to change something in your code, do you want to do it
once or a 100 times?

an alternative would be creating a control array, but since he seems to

have
something working now it seemed bether to expand on that.

eric

"Cor" <no*@non.com> wrote in message
news:O0******** ******@TK2MSFTN GP09.phx.gbl...
Hi Eric,

I was thinking about that solution you told also, but than I did look to
the
answer/question from Solex and thought, yes Solex is right, why would
Scorpion just use one datagrid, while more will maybe fix his problem very simple.

What are your arguments not doing that, I really was in doubt if I
would give the same answer as you?

Cor

> if i recall corectly he's talking about a lot of tabpages
> i do have a suggestion let us know how it turns out
> create a class that holds all the data of 1 tabpage and an integer

to tell
w
> tabpage we are talking about (even better put them in an array, creating > class arrays has been talked about a while back)
> it could have some datasets, strings, ...
> put the code to manipulate the data in the class
> when the user selects a tabpage populate it from the class, if it's

a new
> one it would be blank or you get it from the db, if it's already

filled
in
> populate it from the class.
>



Nov 20 '05 #9
scor,

Obviously I am coming into this a little late, but if you expect this
particular part of the project to continue to grow (i.e. increasing the
number of tabs as time goes on) might I suggest you change your UI design.

I am not familar with the domain problem you are trying to solve but I
cannot imagine that a window with 28+ tabs is going to be particuarly easy
to use. Perhaps a menuing system or treeview will help with navigating to
the particular pages and only load what is necessary upon the users request

To answer your question I think that the approach of having multiple
datagrids and refreshing the datasource when the user clicks on the
approprate tab (and clearing the datasource when the tab has lost focus) is
probably your best bet if you cannot change your GUI.

This way you know that the amount of memory used will grow at resonable
rate. Esentially then number of datagrids times the amount of memory used
per datagrids + the size of the current dataview. If you cache the
dataviews then your memory usage will eventually (if not already) surpass
the above senario as the dataviews increase in size.

Good Luck!
Dan
"scorpion53 061" <sc************ *************** *@yahoo.com> wrote in message
news:eG******** ******@tk2msftn gp13.phx.gbl...
I have something that worked here........it is so simple I may not be
thinking of someting but here goes.....

I declared at the module level 28 different dataviews - one for each tab
page datagrid.

When the user selects that tab page it binds to that view.

The data is there when it is supposed to be and not there when it is not
supposed ot be. It also retained the formatting I call for in code. The only downside is when there were zero rows it showed a datagrid with one square
in teh left hand corner for the grid but I think I can get away with that.

My concern is obviously what effect 28 dataviews will have on the users
resources, and down the road when I need to update the views when the user
is not looking at the tab page if it will be difficult to do.

I assume adding or removing a row from a view is not that hard. At least I
hope.

What do you guys think?
"EricJ" <ericRéMo**@Thi Somnipack.be> wrote in message
news:3f******** **************@ reader1.news.sk ynet.be...
if i recall corectly he's talking about a lot of tabpages
i do have a suggestion let us know how it turns out
create a class that holds all the data of 1 tabpage and an integer to tell
w
tabpage we are talking about (even better put them in an array, creating
class arrays has been talked about a while back)
it could have some datasets, strings, ...
put the code to manipulate the data in the class
when the user selects a tabpage populate it from the class, if it's a

new one it would be blank or you get it from the db, if it's already filled in populate it from the class.

hope it helps

eric

"solex" <so***@nowhere. com> wrote in message
news:O7******** ******@TK2MSFTN GP12.phx.gbl...
Scorpion,

What is the big deal with having two more grids or you could cache the
datasource

Dan
"scorpion53 061" <sc************ *************** *@yahoo.com> wrote in

message
news:u6******** ******@tk2msftn gp13.phx.gbl...
> Well as some of you know I was using a tab control for a project I was > building for my boss.
>
> Today he tells me that he wants:
>
> When he switches tabs to be able to switch back and see whatever it was
he
> was doing on the other tab.
>
> That may not sound like a big thing but I used the same controls for

each
> tab and then manually cleared the page so he didnt see the same in

another
> page. (datasource cleared out etc)
>
> This is what I did:
>
> If TabControl1.Sel ectedIndex = 2 Then
> DataGrid1.DataS ource = Nothing
> DataGrid2.DataS ource = Nothing
> Label2.Text = ""
> Label18.Text = ""
> 'actions to fill them wiht new values
> End If
> If TabControl1.Sel ectedIndex = 1 Then
> DataGrid1.DataS ource = Nothing
> DataGrid2.DataS ource = Nothing
> Label2.Text = ""
> Label18.Text = ""
> 'actions to fill them with new values
> End If
>
> I have to clear it on their arrival other wise they will see the

data from
> the other page, right?
>
> Is there any way I can retain what they did without being forced to

create
> different controls on each tab page?
>
>
>



Nov 20 '05 #10

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

Similar topics

2
1890
by: James | last post by:
Hi I am having some trouble getting a asp page to load. Im a noob to the asp side. I have followed knowledege base Article 301305. I am running 2000 adv, IIS 5.0 I have the following settings to the folder that has the asp. Application settings
4
3850
by: Jacek Dziedzic | last post by:
Hi! First of all, I hope my problem is not too loosely tied to the "standard C++" that is the topic of this group. I have some code that exhibits a strange behaviour: on one computer, where I compile with g++-3.2 it compiles and works fine, on another computer, whether I compile with g++-3.0 or g++-2.95 (unfortunately 3.2 is not available) it crashes with a segmentation violation on runtime.
0
1566
by: Paul C | last post by:
Hello, everybody. I am having trouble running some of the VS.NET samples, specifically the CarSelector web app, which is very simple. The symptom is that the web controls (drop down listboxes and such) do not render correctly. They're almost invisible, and the others don't work at all, but just show their caption text. Not what should happen This strange behavior is happening on my new laptop, which came with XP Home, but I immediately...
0
1510
by: Alexandre Jaquet | last post by:
Hi does anybody know how to solve my trouble, when I try to create a MS Office project I always got trouble. I can't create office project when I try to create one vs.net restart ... :s
2
5782
by: Jeff | last post by:
/* -------------------------------------------------------------------------- Hello, I was experimenting with class templates and specializing member functions and came across a simple problem which I can't figure out. I have a simple class C with 2 template member objects, and a function print() that prints the value of these objects. I defined a specialization of print() for C<string, char> which is called correctly. Then I wanted...
1
2007
by: Jim Bancroft | last post by:
Hi everyone, I'm running into a problem with my ASP.Net application. I've just created a new aspx page which uses some new components of mine that inherit from ServicedComponent and are designed to run under COM+. This page works fine, unless I get fancy and hit my browser's refresh button quickly, as a test. Then, what I see happen is the transactions pile up and my ASP.Net "current requests" do the same. This happens even with two...
6
3812
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory†exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
3
5009
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
2
1560
by: JLupear | last post by:
I am having trouble with my code again, I had prepared a question and the code to upload, however I am having trouble posting it, are there limits to the amount of lines you can post? I split it into 4 parts and am still having trouble uploading it. What am I doing wrong?
0
1680
by: mrchatgroup | last post by:
news from http://www.mrchat.net/myblog/myblog/small-accidents-mean-big-trouble-for-supercollider.html Small Accidents Mean Big Trouble for Supercollider Image Scientists expect startup glitches in the massive, complex machines they use to smash atoms.
0
9724
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10644
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10394
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10127
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7665
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5552
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3863
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.