This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
i have one collection of data that users want to see in two datagrids (rather than having to use the horizontal scroll bar constantly) is there any way of having either one vertical scrollbar that scrolls for both data-grids - or code that will scroll display in "other" datagrid when "first" datagrid is scrolled. have looked at dataGrid.BringRowIntoView - but to do that assume that the selection in the "first" grid needs to change - to get the "selected item" that is then used to scroll data in second grid - am using wpf elements 7.0.561 in a WPF mvvm application |
|
|
Hi Mark, I've just added a HorizontalOffset and VerticalOffset property to the DataGrid which will give you control of the view port. One way to use these would be to bind the property of one DataGrid directly to the property on the other DataGrid:
Or, if you want the value to also be managed in your model, you could bind the property of both DataGrids to a property on your model. These properties will be available in the next nightly build. Let me know if you have further questions about this. -Jason Fauchelle |
|
|
Jason, many thx. will try out this weekend and provide feedback m |
|
|
Jason works as required. many thx for the prompt response m |
|
|
Jason, I have 2 "joined" datagrid synchronised on the same data source (and the scrolling is working perfectly) with the "joined" datagrids, when I first open the screen and select a row in the left grid, corresponding right row is "highlighted". this happens as I select different rows in the left grid (selection mode is single row) if I then select a row in the right grid, the corresponding row in the left grid doesn't change and if I now select a row in the left grid again, the corresponding row in the right row grid does not "highlight" is there a way of ensuring that clicking on a row in either of the two grids (selection mode = single) will result in that row being selected in both of the grids ? thx |
|
|
Hi Mark, One option to do this is to use a CollectionView as the ItemsSource of the data grids, and then also set the IsSynchronizedWithCurrentItem property to true on both data grids. If this is not an option, please let me know how you are currently syncing the selection. Make sure you are using TwoWay bindings. -Jason Fauchelle |
|
|
Jason again - works as required. many thx for the prompt response m |
|