Grid Control


Author
Message
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
a previous life I taught hang-gliding - getting it right the first time even by dumb luck was a big plus

ROFL....yeah I would think that was a HUGE plus! BigGrin

When is the next training class ?

We are working on the dates right now.  We will try to get those posted very soon and we will definitely let you know!

And do you happen to have any more training vids for Stratatrain buyers laying around you might want a beta tester for ?

There is a lot of work going on around this subject right now, so just hang on a little bit and I think you will be pleased with what is coming out. 

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
It must have been something I had done to my test app. ( I was trying to use a BOLibrary and had two child bos with relations set and bos on the form but as yet no controls or data retrieval methods - maybe that was screwing something up )



Anyway, created a new test app - simplest scenario possible - and navigating in the grid does indeed refresh bound controls outside the grid just as I expected it should ( and does in the sample ) with no coding required, so I broke something in my more complicated test app. I added a browsedialog to this one too, so that wasn't it. Must have been those child bos that weren't implemented.



I guess that's how we learn.



I tell. people the reason I love this job is that you learn more from making mistakes than you do from accidentally doing it right. ( it's a nice change actually - in a previous life I taught hang-gliding - getting it right the first time even by dumb luck was a big plus )



As Dilbert says "Creativity is allowing yourself to make mistakes - art is knowing which ones to keep" BigGrin



When is the next training class ? And do you happen to have any more training vids for Stratatrain buyers laying around you might want a beta tester for ? ( I am often used as a test for those who want to 'fool-proof' training material )





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
seems to indicate that it does work the other way around in the sample

You are right Blush I even wrote the sample BigGrin  Early on the this did not work and we made a change to support it...so sorry for the bad data there and for confusing the matter.

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Slowly this is starting to make sense. Are the samples documented/explained someplace in the Help for those of us who are really .NET challenged at this stage?



Yes. If you look at the sample you can see that each of the links (i.e. Next, Previous) calls the Navigate method of the BO. The grid will respect this through the BusinessBindingSource, but not the other way around. If you want to go the other way around then you will have to handle the RowChanged event or something of that nature on the grid and navigate the BO to match the selected row.




I know I'm being dense. I see that the linkss call the navigate method of the BO and that moves the currentrow in the grid, as well as the bound control below. It also works on my SF textboxes I dropped on. But what I am seeing seems to indicate that it does work the other way around in the sample, as putting the cursor in the grid and scrolling down has the same effect as using the links.



I don't get that behavior in my example. so perhaps having those link "methods" ( still haven't quite wrapped my head around how these behave differently than VFP methods ) there makes the difference and that the clicking of the link is not necessary to invoking their functionality, though I am not sure how they are bound to the rowchanging of the grid. I had assumed the link was causing the rowchange AND the change in the control, but now it seems the grid rowchange causes the change in the control however it is accomplished. Hmmmm Cool



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
You guys have made all this look so friendly for us Foxers that it is easy to forget we ain't in Kansas anymore when it comes to data handling.

Smile LOL...thanks....however, I have only dressed up as Dorthy once BigGrin

Did you do something in the sample to make that happen and does it have anything to do with the code snippet I pasted in the previous message ?

Yes.  If you look at the sample you can see that each of the links (i.e. Next, Previous) calls the Navigate method of the BO.  The grid will respect this through the BusinessBindingSource, but not the other way around.  If you want to go the other way around then you will have to handle the RowChanged event or something of that nature on the grid and navigate the BO to match the selected row.

Oh, and what/where is the "SyncWithCurrencyManager" property Ben makes reference to in Post 9138 of this thread and is it relevant here?

I am not sure it even exists on the standard DataGridView, I would have to look.  This exists on some 3rd party grids and that is probably to what he was referencing. 

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
That first paragraph says a lot and reminds me I am a stranger in a strange land

Smile You guys have made all this look so friendly for us Foxers that it is easy to forget we ain't in Kansas anymore when it comes to data handling.



Currently, the part I am having the hardest time understanding is :



When I put two textboxes on the form of the BindingBusinessSource example and bind them to the BO fields, I get the behavior I wanted ( no button involved here ) Scroll through grid and textboxes update in sync



When I do it in my own form, I don't get that. I am starting to get the "there is no record pointer" thing, but when I change rows in the grid isn't some event raised that I can trap and put code in to "refresh" the textboxes or ... ? ( ignorance showing here, I know, but I think it is going to lead to getting the SF data binding a lot better than I do at present ) Aren't they still sharing the same currentdatatable to the point that if I did a navigate in the BO to the row represented in the grid the UI would show that record in the textboxes ?



Did you do something in the sample to make that happen and does it have anything to do with the code snippet I pasted in the previous message ?



Oh, and what/where is the "SyncWithCurrencyManager" property Ben makes reference to in Post 9138 of this thread and is it relevant here?



TIA
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
they are looking at the same currentdatatable I would expect them to be in sync.

OK, first you need to understand that the CurrentDataTable does not actually do anything except house the data.  A DataTable does not have a record pointer, only the BO.  An SF BO keeps up with the "Current" record for you through the CurrentRowIndex property which can be accessed through the CurrentRow property as well.  When talking to a grid, it does not know what the current index of the business object is since it uses the IBindingList and ICurrencyManagerProvider interfaces and has its own internal pointer that is used. 

Depending upon which grid is used the "sync" will be slightly different.  One thing that you can do when the 1.6.1 release is made public is handle the BrowseDialogs AfterBrowse event and then sync it up yourself.  Right now you could use the CurrentDataTableRefilled on the BO that is populated through the Browse and add the same type of logic.

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
Yes, I looked at the example. I understand the handlers for the next etc under the grid. My question regards having the change of row in the grid cause bound controls on the form for an individual record refresh as the grid row changes.



In the sample I tried putting a couple of textboxes on the form below the grid, bindign them to company and last name and with your grid I got the expected behavior - i.e. as the row changed in the grid the bound control changed. Since they are looking at the same currentdatatable I would expect them to be in sync.



But I don't get that behavior in the form I am attempting. I have a standard maintenance form with customer fields. I setup a browsedialog which works fine to retrive records. So far so good.



So then I dropped DataGridView onto the form, set up a BusinessBindingSource to CustomersBO1 and set the datasource for the grid to the BBS. Now when I return from the BrowseDialog I have the right record in the bound fields, the right set of records in the grid, but they are not in sync and navigating in the grid does not refresh the displayed record.



( exception is if I scroll down the grid to EOF I have both a blank grid row and blank bound controls )



Remember, I'm a .NET idiot still thinking VFP Smile



I don't see anything in the sample in that respect and yet it works there as I would expect but not in mine. Any hints as to where I should look for what I have obviously left out ?



The only code i see in the sample that might (?) be relevant if I understood it is



'''

''' When the row changes within the grid, the Navigated event will fire

'''


'''

'''

Private Sub Customers_Navigated(ByVal e As MicroFour.StrataFrame.Business.NavigatedEventArgs) Handles Customers.Navigated

Me.lblRowIndex.Text = Me.Customers.CurrentRowIndex.ToString()

End Sub





TIA for you patience.







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
If you will open up the BusinessBindingSource sample, it has the Next - Previous links that navigate the grid.  Have you looked at this sample to see how this is implemented?

can anyone point me to help re incremental searching in DataGridViews or the browse that comes with the SF browsedialog ? ( ala VFP - start typing in column and it seeks next matching record etc )

When 1.6.1 is released you can implement your own incremental search in a browse since the ListView is exposed through an InfoPanel control.  A ListView already has incremental search capabilities.

Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I have a DataGridView working on a form using BusinessBindingSource but can't seem to find any property of the grid relating to SyncwithCurrencyManager ( or anything re currency manager )



I have bound controls on the form for a single record and would like to refresh those control as the user navigates the ( readonly ) grid.



Ben - anymore clues on the property you mentioned?



Second part of question : can anyone point me to help re incremental searching in DataGridViews or the browse that comes with the SF browsedialog ? ( ala VFP - start typing in column and it seeks next matching record etc )



TIA



Charles
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