Listview and BO Synchronization


Author
Message
Torsten Weggen
Torsten Weggen
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: Forum Members
Posts: 4, Visits: 21
Hi folks,



I'm new to strataframe and now in my evaluation phase. I took one form from my actual VFP-Application and want to do exact the same thing with .NET / strataframe. I think this is the best way for evaluation because you cross a lot of real world problems when doing it this way. My application is written with a Vfp-Framework not known in the english world (its german), but it uses in many ways the same approach to do things like strataframe do.



OK thats the preliminarys, now my question(s):



I have a form which is dealing with invoices. I put all the textboxes and checkboxes on my form, coupled them to the BO and everything works fine. The next step was to add a listview to the form to scroll through the invoices. (See the screenshot)







My first problem is the synchronization between listview and the data entry controls. My first try was setting the listview-property "AutoNavigateToSelectedRecord" to true but nothing happend. The next thing was using the "ItemSelectionChanged" method with the code





private void listView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)

{

int primkey = (int)e.Item.Tag;

rechBO1.NavigateToPrimaryKey(primkey);



}





Navigation works fine with this, but what should I do, when I use a navigation-button in the form ? The "Selection-Row" of the listview is not in synch when I navigate with the BO-Navigate-Methods.



Next question is what to do with the listview, when I add a record or change the content of one record and save. Changes are not visible in the listview. Do I really have to repopulate the whole listview on every change ? This is really not the fastest thing when I have 10000 invoices in my database...



And the last question for today: The listview has a property "AutoColumnSort". In the documentation is written, that turning this property to true allows sorting by click on the listview header. But when I set this to true, my form does not start any more and after a while I get a COM Timeout-Message. Is this a bug or a feature ?



Best regards

Torsten Weggen

indisoftware GmbH

Hanover, Germany



Replies
Torsten Weggen
Torsten Weggen
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: Forum Members
Posts: 4, Visits: 21
Sorry, I could not edit my post , so here is the correct image:




Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Torsten and welcome to the forums.

I understand you want to use the listview to drive the navigation of the records and synch it with the SF navigation toolstrip. 

The SF listview was not designed to do that, but Greg McGuffey posted a class to handle that kind of situation, you can find all the explanations here http://forum.strataframe.net/Topic14966-26-1.aspx

If you don't want to follow that route, you can make use of the Browser Dialog (BD) to bring only the invoice record in which the end user will work with (yes one at a time) or if you need to work on a bulk invoice process, then you can use the same BD to filter out all the invoices and fill the BO with only those needed in your list. 

As you can see there are many way to deal with this, it will all come down to what are your real requirements and how you want to present that to the end user.

Edhy Rijo

Torsten Weggen
Torsten Weggen
StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)StrataFrame Beginner (4 reputation)
Group: Forum Members
Posts: 4, Visits: 21
@ Edhy,



thank you very much, this was the right way. I ve had a little troble to convert this to C# first, but now it runs like hell BigGrin



@ All

so now my test-form is growed up some more steps, I added a parent-child relationship for the invoice-positions and everything has been a lot easier than I thought before. Nice nice.



Take a look on my actual screenshot.







Not bad for a first try, hmm ?



OK, there are 2 problems left (for now Wink ).



1.) As mentioned in my first post, setting the property "autocolumnsort" of the listview leads to a very long time of waiting before the form is shown. With my 10000 invoices in the Test-DBC, I get a timeout COM-Error after a while. Any ideas where to look at ?



2.) The other thing is more a question for ideas. In our VFP-Framework classmaxx, we have the opportunity of starting a thing we call "Query-By-Form". You hit a button, every data entry control unbinds from its data source and you can enter values to search for. After that, you hit the button again and a where-clause will be derived from the controls. Controls are databound again and the where-clause is used for filtering the data. Our customers love this feature and I surely have to implement this in strataframe too.



Do you have any first thoughts about how to implement this and where to go inside ?
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Torsten,

Glad you are finding your ways.

1.) As mentioned in my first post, setting the property "autocolumnsort" of the listview leads to a very long time of waiting before the form is shown. With my 10000 invoices in the Test-DBC, I get a timeout COM-Error after a while. Any ideas where to look at ?

You can fill your BO data in any way you want, so just add the "ORDER BY" clause to your FillByXXX method to present your data sorted.

2.) The other thing is more a question for ideas. In our VFP-Framework classmaxx, we have the opportunity of starting a thing we call "Query-By-Form". You hit a button, every data entry control unbinds from its data source and you can enter values to search for. After that, you hit the button again and a where-clause will be derived from the controls. Controls are databound again and the where-clause is used for filtering the data. Our customers love this feature and I surely have to implement this in strataframe too.

Do you have any first thoughts about how to implement this and where to go inside ?

SF does not have such a thing like "Query-By-Form" and in fact you may really don't need it.  SF has a very powerful Dialog Browser component which will let your users search for the data they need with a great deal of flexibility for them and specially you the developer and keep it easier to maintain.

As I have been told by many experience SF developers, you have to let go the VFP way and learn the new thing you can do with .NET & StrataFrame, these are a whole new type of UI concept design (See the StrataFlix sample application) with a disconnected database (MS-SQL) which in most cases does not makes sense to allow the end user to bring down all records when then will only work with one at a time. 

My suggestion here would be not to try to mimic the VFP application design, instead use its foundation and logic to rebuild a new application with SF that will get you what you want with a more fresh look (of course that will require a bit more experience) but I am a living proof it is doable and there are many other SF developers which also came from VFP environment that can probe the same thing.

Your new form looks nice, and it can look even better by adding a PanelManager or a ThemedPanel which will follow the theme of your ThemedToolStrip and much more.  Also trying to modify the child data using textboxes in the same form, you can take full advantage of the ListView Automation tools in which you can create a ChildForm to provide data access to your listview with a few powerful setting in the listview in which you will have more control of the child data and its validation.

Again look at the StrataFlix application which is a great source to show how the tools can be used.

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