Std Data grid view and SF Toolstrip don't communicate with each other!


Std Data grid view and SF Toolstrip don't communicate with each other!...
Author
Message
Ben Hayat
Ben Hayat
Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
Hi Trent;



Thanks for th reply; I don't mind using ListView but listview raises another important question the way it connects to BO and populate itself.



When doing "populate datasource settings", it uses the BO class and the BO Class method to populate itself [u]Rather[/u] than the local instance of that BO on the form. I may have one BO class, but each form may use an instance of that BO and may have a different method to populate the BO. And since the listview doesn't see the BO instance, that can be a problem.

Is my understanding correct on this? And that was one of the reason I approached Data grid to bind to the local instance of BO via BBS.

..ßen
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Let's take the ListView approach since it is less complicated to explain.  SF comes with several ListView samples that show how to use ListViews with child records and how to move the record pointer.

If you take a ListView, you will handle the SelectedIndexChanged event and then seek (or navigate depedning upon your needs) which will then move the record pointer and update any bound fields.  We generally store the primary key in the Tag property of the ListView and then use it for the navigation:

Private Sub MyListView_SelectedIndexChanged(Byval sender as Object, Byval e as EventArgs) Handles MyListView.SelectedIndexChanged

    If MyListView.SelectedItems.Count > 0 Then
        MyBO.NavigateToPrimaryKey(CType(MyListView.SelectedItems(0).Tag, Integer))
    End If

End Sub

The same thing is true with a grid.  You will have to manage the RowChanged or whatever event the grid you are using provides and then add the same logic.

Ben Hayat
Ben Hayat
Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)Advanced StrataFrame User (946 reputation)
Group: Forum Members
Posts: 374, Visits: 1.2K
I mentioned this as part of another post, but I thought to make it as a post of it's own.



I see a consistent problem trying to have data grid and SF navigation toolstrip to work with each other. The toolstrip does move the record pointer and I can see data in text box change, but the pointer in the grid does not change. The same problem exists vice versa. If I move the pointer in the grid, the data in the text box does not change.



Note: I actually had the same problem using ListView and I thought ListView is less capable than Std Grid View, so I changed to Grid view, but the same problem still continues.

I also looked at the sample (Business Binding Source) and the grid and toolstrip work together. And I can't find what else needs to be set.



My setup:

BO,

BBS

Data Grid view



Thanks!

..ßen
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