Re:In trouble.....
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" <
scorpion_53061nospamhereplease@yahoo.com>wrote in message
Quote
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" <solex@nowhere.com>wrote in message
news:%23A0p47yvDHA.2448@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" <scorpion_53061nospamhereplease@yahoo.com>wrote in
message
>news:%23IU6v1yvDHA.556@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" <solex@nowhere.com>wrote in message
>>news:OEgTKryvDHA.2508@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" <scorpion_53061nospamhereplease@yahoo.com>wrote in
>>message
>>>news:eGcc5oxvDHA.3224@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éMoVe@ThiSomnipack.be>wrote in message
>>>>news:3fd6d5d2$0$2856$ba620e4c@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" <solex@nowhere.com>wrote in message
>>>>>news:O78ZlJqvDHA.1272@TK2MSFTNGP12.phx.gbl...
>>>>>>Scorpion,
>>>>>>
>>>>>>What is the big deal with having two more grids or you could
cache
>>the
>>>>>>datasource
>>>>>>
>>>>>>Dan
>>>>>>
>>>>>>
>>>>>>"scorpion53061" <scorpion_53061nospamhereplease@yahoo.com>
wrote
>in
>>>>>message
>>>>>>news:u6UWPDqvDHA.1088@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?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
-