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
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
Replies
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
Greg;



Synching ListView to CurrentRow

Just handle the BO's Navigated event and select the appropriate item in the list view. I pretty sure the only way is to walk the items in the list view, checking the Tag to equal the pk of the current row. Maybe Trent/Ben has another/better method.




This is the tricky one! Are you saying that we need to iterate thru all the items of the list view to match the current row in BO table?

..ßen
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
yep. It most likely won't be all the rows, just until it finds the correct one. BigGrin



There may be a better way. This works if the list is small.



Another possibility would be to keep a dictionary (created when you load the list initially) that tracks the list index to the PK. The PK would be the key, the index would be the value.
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
Greg, my original question was really aimed at BBS and grid and got side tracked to Listview.



There is a sample called BusinessBindingSource which does exactly what I need to do.

You drop a BO on a form.

you drop BBS on the form and connect it to BO

You then put a grid on the form and connect it's data source to BBS.



On the sample it works and when I do this on my form, I see the data in grid but has no two way binding. I've looked every single property and don't see why. The sample has no code to force the two way binding.



Could someone point me to right direction.



Thanks!

..ßen
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, so you are saying that when you use the BBS with a grid view and navigate the BO using some method (toolstrip or links) that the grid doesn't navigate?



I'd check out the properties of the grid. Maybe there is property that indicates the grid selection should change when the datatable current row changes and it's turned off???



I don't know much about ADO.NET, but I do know that BOs just wrap a datatable, and the BBS is bound via that datatable, so the grid changing selected rows is very likely just a .NET thing, not related to SF at all....just a guess.



Good luck!
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
Greg McGuffey (06/12/2007)
OK, so you are saying that when you use the BBS with a grid view and navigate the BO using some method (toolstrip or links) that the grid doesn't navigate?



I'd check out the properties of the grid. Maybe there is property that indicates the grid selection should change when the datatable current row changes and it's turned off???



I don't know much about ADO.NET, but I do know that BOs just wrap a datatable, and the BBS is bound via that datatable, so the grid changing selected rows is very likely just a .NET thing, not related to SF at all....just a guess.



Good luck!




Greg, check out my other post. Just found the problem!

..ßen
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ben Hayat - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Ben Hayat - 18 Years Ago
Trent L. Taylor - 18 Years Ago
Ben Hayat - 18 Years Ago
Greg McGuffey - 18 Years Ago
                 Trent posted faster than I did! :D
Greg McGuffey - 18 Years Ago
Ben Hayat - 18 Years Ago
                 Greg;

[quote]Synching ListView to CurrentRow
Just...
Ben Hayat - 18 Years Ago
Greg McGuffey - 18 Years Ago
                         Greg, my original question was really aimed at BBS and grid and got...
Ben Hayat - 18 Years Ago
                             OK, so you are saying that when you use the BBS with a grid view and...
Greg McGuffey - 18 Years Ago
                                 [quote][b]Greg McGuffey (06/12/2007)[/b][hr]OK, so you are saying that...
Ben Hayat - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search