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

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.SelectedIndex = 2 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.SelectedIndex = 1 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = 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 1322
Scorpion,

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

Dan
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.SelectedIndex = 1 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = 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**************@TK2MSFTNGP12.phx.gbl...
Scorpion,

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

Dan
"scorpion53061" <sc****************************@yahoo.com> wrote in message news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.SelectedIndex = 1 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = 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**************@TK2MSFTNGP09.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**@ThiSomnipack.be> wrote in message
news:3f*********************@reader5.news.skynet.b e...
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**************@TK2MSFTNGP09.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**@ThiSomnipack.be> wrote in message
news:3f**********************@reader1.news.skynet. 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**************@TK2MSFTNGP12.phx.gbl...
Scorpion,

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

Dan
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = Nothing
Label2.Text = ""
Label18.Text = ""
'actions to fill them wiht new values
End If
If TabControl1.SelectedIndex = 1 Then
DataGrid1.DataSource = Nothing
DataGrid2.DataSource = 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

"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:uE**************@TK2MSFTNGP11.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**@ThiSomnipack.be> wrote in message
news:3f*********************@reader5.news.skynet.b e...
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**************@TK2MSFTNGP09.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
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:eG**************@tk2msftngp13.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**@ThiSomnipack.be> wrote in message
news:3f**********************@reader1.news.skynet. 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**************@TK2MSFTNGP12.phx.gbl...
Scorpion,

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

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

message
news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
> DataGrid1.DataSource = Nothing
> DataGrid2.DataSource = Nothing
> Label2.Text = ""
> Label18.Text = ""
> 'actions to fill them wiht new values
> End If
> If TabControl1.SelectedIndex = 1 Then
> DataGrid1.DataSource = Nothing
> DataGrid2.DataSource = 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
The way this was working was that whenever a tab was clicked it was told to
add the same set of controls to the page. (2 datagrids, 8 labels, six
buttons)

Do you think that as each tab page is clicked that the framework will
iniitiate garbage collection as needed or do I need to manually somehow
dispose of the controls to keep them from bombing the resources on the
computer?

As far as why the tab control was chosen that was the bosses choice. IT
certainly was not mine. I have not cared for the trouble this particular
control has caused me. Granted, my inexperience with the control has been a
factor, but there are some bugs with this control that make life
interesting.

I don't want to clear the datasource when teh leave the tab page otherwise
the user when they return will not see what they had done when they were
there previously. My concern is how to keep the various dataviews updated if
things they do on other tab pages affect what result they should be viewing.
Using the same datagrid presented binding problems but what I did was create
a dataview for each screen's grid and told to bind to that dataview when
they returned.

Thanks much for your thoughts. If you have more I would love to hear them.

"solex" <so***@nowhere.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
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
"scorpion53061" <sc****************************@yahoo.com> wrote in message news:eG**************@tk2msftngp13.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**@ThiSomnipack.be> wrote in message
news:3f**********************@reader1.news.skynet. 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**************@TK2MSFTNGP12.phx.gbl...
> Scorpion,
>
> What is the big deal with having two more grids or you could cache
the > datasource
>
> Dan
>
>
> "scorpion53061" <sc****************************@yahoo.com> wrote in
message
> news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
> > DataGrid1.DataSource = Nothing
> > DataGrid2.DataSource = Nothing
> > Label2.Text = ""
> > Label18.Text = ""
> > 'actions to fill them wiht new values
> > End If
> > If TabControl1.SelectedIndex = 1 Then
> > DataGrid1.DataSource = Nothing
> > DataGrid2.DataSource = 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 #11
Let me reiterate to make sure I understand your requirements

(1) the dataviews you have are based on a datatable.
(2) there are 28+ dataviews that you need to maintain their state as they
are changed by the user
(3) if a dataview is changed in a way the updates the underlying datatable
you do NOT want the other dataviews to be updated.
(4) persumably you want the user to have the ability to view all of thier
changes before they commit the entire set of changes to the underlying
datatable.

Is this correct?

Dan
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
The way this was working was that whenever a tab was clicked it was told to add the same set of controls to the page. (2 datagrids, 8 labels, six
buttons)

Do you think that as each tab page is clicked that the framework will
iniitiate garbage collection as needed or do I need to manually somehow
dispose of the controls to keep them from bombing the resources on the
computer?

As far as why the tab control was chosen that was the bosses choice. IT
certainly was not mine. I have not cared for the trouble this particular
control has caused me. Granted, my inexperience with the control has been a factor, but there are some bugs with this control that make life
interesting.

I don't want to clear the datasource when teh leave the tab page otherwise
the user when they return will not see what they had done when they were
there previously. My concern is how to keep the various dataviews updated if things they do on other tab pages affect what result they should be viewing. Using the same datagrid presented binding problems but what I did was create a dataview for each screen's grid and told to bind to that dataview when
they returned.

Thanks much for your thoughts. If you have more I would love to hear them.

"solex" <so***@nowhere.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
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
"scorpion53061" <sc****************************@yahoo.com> wrote in

message
news:eG**************@tk2msftngp13.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**@ThiSomnipack.be> wrote in message
news:3f**********************@reader1.news.skynet. 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**************@TK2MSFTNGP12.phx.gbl...
> > Scorpion,
> >
> > What is the big deal with having two more grids or you could cache

the > > datasource
> >
> > Dan
> >
> >
> > "scorpion53061" <sc****************************@yahoo.com> wrote
in > message
> > news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
> > > DataGrid1.DataSource = Nothing
> > > DataGrid2.DataSource = Nothing
> > > Label2.Text = ""
> > > Label18.Text = ""
> > > 'actions to fill them wiht new values
> > > End If
> > > If TabControl1.SelectedIndex = 1 Then
> > > DataGrid1.DataSource = Nothing
> > > DataGrid2.DataSource = 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 #12
Cor
Hi Scorpion,

I am curious also and I take the text from Solex

1) the dataviews you have are based on a datatable.

Is every dataview also one datatable or are all dataviews, views on the same
datatable (as part of a dataset or more datasets)?

Cor

Nov 20 '05 #13
Each has their own dataset and can be updated (row delete, modify, add)
independantly.

What I want to do is in some cases but not all changes in one dataview may
need to be reflected in another dataview.
"Cor" <no*@non.com> wrote in message
news:uM**************@TK2MSFTNGP09.phx.gbl...
Hi Scorpion,

I am curious also and I take the text from Solex

1) the dataviews you have are based on a datatable.

Is every dataview also one datatable or are all dataviews, views on the same datatable (as part of a dataset or more datasets)?

Cor

Nov 20 '05 #14
1 the dataviews are based on several tables. Each dataset has its own
dataview the way it is currently set up. Each dataset is copied to another
dataset called dscopy so that formatting rules and such can be applied
without having to write 28 formatting procedures.

2-3. Yes I need to maintaint their state but I also need to be able to
adjust it. For example if an item is added ot the order the order dataview
would need to be addressed so that when they returned to that screen the
item would show as being there.

4. Would be a very nice addition. DO not currently have it in place however.
Open to anyting here.

I hope I am clear. It is confusing I know.

"solex" <so***@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Let me reiterate to make sure I understand your requirements

(1) the dataviews you have are based on a datatable.
(2) there are 28+ dataviews that you need to maintain their state as they
are changed by the user
(3) if a dataview is changed in a way the updates the underlying datatable
you do NOT want the other dataviews to be updated.
(4) persumably you want the user to have the ability to view all of thier
changes before they commit the entire set of changes to the underlying
datatable.

Is this correct?

Dan
"scorpion53061" <sc****************************@yahoo.com> wrote in message news:%2***************@TK2MSFTNGP11.phx.gbl...
The way this was working was that whenever a tab was clicked it was told to
add the same set of controls to the page. (2 datagrids, 8 labels, six
buttons)

Do you think that as each tab page is clicked that the framework will
iniitiate garbage collection as needed or do I need to manually somehow
dispose of the controls to keep them from bombing the resources on the
computer?

As far as why the tab control was chosen that was the bosses choice. IT
certainly was not mine. I have not cared for the trouble this particular
control has caused me. Granted, my inexperience with the control has been a
factor, but there are some bugs with this control that make life
interesting.

I don't want to clear the datasource when teh leave the tab page otherwise the user when they return will not see what they had done when they were
there previously. My concern is how to keep the various dataviews updated
if
things they do on other tab pages affect what result they should be viewing.
Using the same datagrid presented binding problems but what I did was

create
a dataview for each screen's grid and told to bind to that dataview when
they returned.

Thanks much for your thoughts. If you have more I would love to hear

them.
"solex" <so***@nowhere.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
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
"scorpion53061" <sc****************************@yahoo.com> wrote in

message
news:eG**************@tk2msftngp13.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**@ThiSomnipack.be> wrote in message
> news:3f**********************@reader1.news.skynet. 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**************@TK2MSFTNGP12.phx.gbl...
> > > Scorpion,
> > >
> > > What is the big deal with having two more grids or you could
cache the
> > > datasource
> > >
> > > Dan
> > >
> > >
> > > "scorpion53061" <sc****************************@yahoo.com> wrote in > > message
> > > news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
> > > > DataGrid1.DataSource = Nothing
> > > > DataGrid2.DataSource = Nothing
> > > > Label2.Text = ""
> > > > Label18.Text = ""
> > > > 'actions to fill them wiht new values
> > > > End If
> > > > If TabControl1.SelectedIndex = 1 Then
> > > > DataGrid1.DataSource = Nothing
> > > > DataGrid2.DataSource = 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 #15
scor.,

Based on your comments, I am not really sure what would be the problem in
updating the underlying datasets as changes to the data is made. For
instance consider the following sequences

User makes changes to Page N
System updates underlying dataset as a result of the changes
System updates underlying dataset(s) for any dependent tables
System refreshes current Page

User selects new Page
System recreates underlying dataset for New Page
System recreate undelying dataview and rebinds

Obviously your application is getting compilcated and based on my
experience and from what I can gather from your descriptions, I would start
thinking about creating an object model that houses both the data and the
interactions between the objects and ditch the DataTable/DataView
assemblies.

IMHO the DataTable and DataViews /Binding will only get you so far and then
you hit a brick wall. I'm sure that there are work arounds and neat tricks
to get things to work but at what point do you say to yourself that the code
you have created is too complicated and too difficult to modify if you need
to add a new feature such as item (4) in my previous post.

Dan
"scorpion53061" <sc****************************@yahoo.com> wrote in message
news:ea**************@TK2MSFTNGP12.phx.gbl...
1 the dataviews are based on several tables. Each dataset has its own
dataview the way it is currently set up. Each dataset is copied to another
dataset called dscopy so that formatting rules and such can be applied
without having to write 28 formatting procedures.

2-3. Yes I need to maintaint their state but I also need to be able to
adjust it. For example if an item is added ot the order the order dataview
would need to be addressed so that when they returned to that screen the
item would show as being there.

4. Would be a very nice addition. DO not currently have it in place however. Open to anyting here.

I hope I am clear. It is confusing I know.

"solex" <so***@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Let me reiterate to make sure I understand your requirements

(1) the dataviews you have are based on a datatable.
(2) there are 28+ dataviews that you need to maintain their state as they
are changed by the user
(3) if a dataview is changed in a way the updates the underlying datatable you do NOT want the other dataviews to be updated.
(4) persumably you want the user to have the ability to view all of thier changes before they commit the entire set of changes to the underlying
datatable.

Is this correct?

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

message
news:%2***************@TK2MSFTNGP11.phx.gbl...
The way this was working was that whenever a tab was clicked it was told
to
add the same set of controls to the page. (2 datagrids, 8 labels, six
buttons)

Do you think that as each tab page is clicked that the framework will
iniitiate garbage collection as needed or do I need to manually
somehow dispose of the controls to keep them from bombing the resources on the
computer?

As far as why the tab control was chosen that was the bosses choice. IT certainly was not mine. I have not cared for the trouble this particular control has caused me. Granted, my inexperience with the control has

been
a
factor, but there are some bugs with this control that make life
interesting.

I don't want to clear the datasource when teh leave the tab page

otherwise the user when they return will not see what they had done when they were there previously. My concern is how to keep the various dataviews updated
if
things they do on other tab pages affect what result they should be

viewing.
Using the same datagrid presented binding problems but what I did was

create
a dataview for each screen's grid and told to bind to that dataview when they returned.

Thanks much for your thoughts. If you have more I would love to hear

them.
"solex" <so***@nowhere.com> wrote in message
news:OE**************@TK2MSFTNGP12.phx.gbl...
> 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
>
>
> "scorpion53061" <sc****************************@yahoo.com> wrote in
message
> news:eG**************@tk2msftngp13.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**@ThiSomnipack.be> wrote in message
> > news:3f**********************@reader1.news.skynet. 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**************@TK2MSFTNGP12.phx.gbl...
> > > > Scorpion,
> > > >
> > > > What is the big deal with having two more grids or you could

cache the
> > > > datasource
> > > >
> > > > Dan
> > > >
> > > >
> > > > "scorpion53061" <sc****************************@yahoo.com>
wrote in
> > > message
> > > > news:u6**************@tk2msftngp13.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.SelectedIndex = 2 Then
> > > > > DataGrid1.DataSource = Nothing
> > > > > DataGrid2.DataSource = Nothing
> > > > > Label2.Text = ""
> > > > > Label18.Text = ""
> > > > > 'actions to fill them wiht new values
> > > > > End If
> > > > > If TabControl1.SelectedIndex = 1 Then
> > > > > DataGrid1.DataSource = Nothing
> > > > > DataGrid2.DataSource = 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 #16
Cor
Hi Scorpion,

I was busy with something to investigate for Elena when I got this idea.

It is very quick and very dirty, but maybe it gives you some ideas

Cor
\\\\
Private dts(28) As DataTable
Private tabpages(28) As TabPage
Private dvs(28) As DataView
Private Sub DataForm1_Load(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Tabcontrol1 As New System.Windows.Forms.TabControl
Tabcontrol1.SuspendLayout()
Tabcontrol1.Dock = System.Windows.Forms.DockStyle.Fill
Tabcontrol1.Location = New System.Drawing.Point(0, 0)
Tabcontrol1.Name = "TabControl1"
Tabcontrol1.SelectedIndex = 0
Tabcontrol1.Size = New System.Drawing.Size(392, 216)
Tabcontrol1.TabIndex = 0
Me.Controls.Add(Tabcontrol1)
For i As Integer = 0 To 27
makedatatable(i)
tabpages(i) = settabpage(i, dts(i))
Tabcontrol1.Controls.Add(tabpages(i))
Next
End Sub
Private Sub makedatatable(ByVal number As Integer)
dts(number) = New DataTable("Action")
dts(number).Columns.Add(New DataColumn("Item", _
Type.GetType("System.Int32")))
dts(number).Columns.Add(New DataColumn("Alfa", _
Type.GetType("System.String")))
For i As Integer = 0 To 10
Dim dr As DataRow = dts(number).NewRow
dr("Item") = i * number
dr("Alfa") = (i * number).ToString
dts(number).Rows.Add(dr)
Next
dvs(number) = New DataView(dts(number))
End Sub

Public Function settabpage(ByVal number As Integer, _
ByVal datatable As DataTable) As TabPage
Dim TabPage2 As New System.Windows.Forms.TabPage
TabPage2.Text = number.ToString
TabPage2.Dock = DockStyle.Fill
Dim datagrid2 As New System.Windows.Forms.DataGrid
datagrid2.HeaderForeColor = System.Drawing.SystemColors.ControlText
datagrid2.DataSource = dvs(number)
datagrid2.AllowSorting = True
datagrid2.ReadOnly = False
datagrid2.Dock = DockStyle.Fill
Dim dgts As DataGridTableStyle = New DataGridTableStyle
dgts.MappingName = "Action"
dgts.GridColumnStyles.Add(New DataGridTextBoxColumn)
dgts.GridColumnStyles.Item(0).MappingName() = "item"
dgts.GridColumnStyles.Item(0).HeaderText = "Action"
datagrid2.TableStyles.Clear()
datagrid2.TableStyles.Add(dgts)
datagrid2.Refresh()
datagrid2.Visible = True
datagrid2.ColumnHeadersVisible = True
TabPage2.Controls.Add(datagrid2)
Return TabPage2
End Function
////
Nov 20 '05 #17

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

Similar topics

2
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...
4
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...
0
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...
0
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
by: Jeff | last post by:
/* -------------------------------------------------------------------------- Hello, I was experimenting with class templates and specializing member functions and came across a simple problem...
1
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...
6
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...
3
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 : ...
2
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...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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...

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.