How to synch a DataGridView in a SF Maintenance Form with a single BO?


How to synch a DataGridView in a SF Maintenance Form with a single BO?...
Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Greg McGuffey (03/14/2008)
I totally understand. I was there not so long ago. It's very cool when it starts to click BigGrin.

If I get a chance, I'll post the control in a sample app next week...no promises, it's been busy.

Well, you want believe how happy I was to have the snippet working, since that will save me some time and it is way better than copy and paste.

Thanks for the offer.

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (03/14/2008)
Oh, I just noticed what you were referring to on Ben Hayats post...the BBS was never intended to interact with the MaintenanceFormToolstrip in that manner.  I see why you are wanting to do that, but this has more to do with the grid rather than the navigated event.  Each grid is slightly different in the way that it determines the "active" row.  This is why most developers implement their own grid navigation logic here.  Also, if you are using a grid for a child data source, in most cases it is being presented to allow the end-user to select the child record, which DOES fire the navigated event in the BO.  It is working backwards that you are wanting.  I will look at this, but that is why it was not changed.  Ben Hayat kept demanding that we make a change, but this change entailed more than just an encapsulated change. 

I will look at this again and refresh my memory, and it is still in a list that we keep up with, but that is the issue.

Trent, I am glad to see you understood my situation.  In this project I estimate having at least 8-12 simple Maintenance form in which I would like to use my form layout of showing the data in a grid or listview, and 3-5 main forms which will require a lot of coding (remember I am re-doing my VFP applications with SF).  That is why I am testing the grid and the listview to decide which one I will use for these forms, so this will be a kind of repeating thing in all my projects and I really hate to copy & paste all the time.

Greg McGuffey has a class for the listview that he may be able to post some sample next week, but that may not happen, so if it is easier for you to post some start code for me to give it a shot in creating a similar class for the listview, I am willing to take the risk Hehe and spend the time working with this class, just be ready for more questions Wow

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
OK....I was right in that it isn't a bug.  When everyone kept saying that it was the maintenance form I ignored that statement because a MaintenanceForm is a Standard form with a gradient form header and a maintenance form toolstrip attached to it...however BigGrin ... there is something in the InitializeComponent that is causing this form to act a little from through this tempalte...I will dig that out and determine where the issue is.

I have attached a test program that does what you want.  If you navigate through the maintenance form toolstrip, the data grid view is updated.  If you select a record through the grid, it updates and fires the Navigated event.  It works as advertised...there must be something in the MaintenanceForm template that is causing the funny behavior.

Anyway, all you have to do is this to produce a maintenance form:

  1. Create a Standard Form
  2. Drop on a gradient form header
  3. Drop on a maintenance form toolstrip

That's it Smile

I would not have believed that in a million years if I didn't see it with my own eyes w00t.

This sample uses the StrataFrameSample database and has a maintenance form toolstrip on it and loads the top 100 records and show them in a grid view.

Attachments
TestGridView.zip (89 views, 74.00 KB)
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Trent,

I tested your sample and it fact works, but it is not stable. At some point it will stop working, either if I add a GroupBox or a ThemedContainer, it will stop working and after a while for no reason.

I guess will have to use the ListView as suggested before in order to keep moving on.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
I tested your sample and it fact works, but it is not stable. At some point it will stop working, either if I add a GroupBox or a ThemedContainer, it will stop working and after a while for no reason.

Edhy, I have tested this over and over and it works fine.  I am not sure what issue you are running into here, but there is more than likely something else being placed in your code that is causing the issue.  I have also double-checked with some people that I KNOW are using this logic and they are not having issues.  You might dig a little deeper...I prefer the ListView method anyway, but if you want to keep with this, people use grids in this fashion everyday...so I think that there is probably something else going on here.

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (03/17/2008)
Edhy, I have tested this over and over and it works fine.  I am not sure what issue you are running into here, but there is more than likely something else being placed in your code that is causing the issue.  I have also double-checked with some people that I KNOW are using this logic and they are not having issues.  You might dig a little deeper...I prefer the ListView method anyway, but if you want to keep with this, people use grids in this fashion everyday...so I think that there is probably something else going on here.

Thanks Trent, I will keep looking at this since I like the fact of the grid being manage/synch with the MaintenanceFormToolStrip.

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I've posted a sample with a sub-classed listview:



http://forum.strataframe.net/FindPost14966.aspx
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Greg, I will check it out now.

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search