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
|
The WPF DataGrid has a couple of ScrollIntoView methods. Does the Mindscape DataGrid provide the same functionality? Typically I use the ScrollIntoView(object x) override and pass in the instance of the object I want to be visible on the screen (that object is in the ItemsSource collection). I didn't notice a nice way to do this with your DataGrid. Thanks. |
|
|
Hello Jared We have a BringCellIntoView method on the DataGrid which brings a given cell into the view port. The next nightly build will include a BringRowIntoView method which will be more convenient for your situation. You can use the BringCellIntoView method if you need to consider horizontal scrolling to a particular cell as well. Jason Fauchelle |
|
|
Jason, thanks for the change. It seems to work well other than when the item is the last item in the collection. BringRowIntoView(item) scrolls half of the item into view. I have to use the scrollbar to get the full item into view. Thanks. |
|
|
Hello Jared I can reproduce this issue but haven't found a good way to resolve this yet. I've noted this down to look into in a future update. Jason Fauchelle |
|
|
Thank you! |
|
|
Hi Jason, Does this BringRowIntoView() for the last row get fixed? I also tried BringCellIntoView(), it just cannot bring the last row into view. If adding an item to the end, then every time need to scroll, which is very inconvenient for the user. My situation is that I cannot see the last row even not half of the row. But it works for last 2nd row.... I am using Nov 19,2012 nightly build. Can you fix them? Thanks Gordon |
|
|
Hello Gordon This bug will be resolved in the next nightly build. After you add an item to the data grid, and then call BringRowIntoView, the last row will fully be displayed. Jason Fauchelle |
|
|
Hi Jason, I downloaded Nov 23 nightly build and It still does not work! No matter it id bindinglist or datatable. Gordon |
|
|
Hello Gordon I've found another way to reproduce this and have made another fix for this which will be available in the next nightly build. Jason Fauchelle |
|
|
Hi Jason, It is still not fixed, here is the reproduce project. I am using Nov. 26, 2012 build. When you click on Add button, it does not scroll into view for the last column. |
|
|
Hello Gordon When using a DataTable in a DataGrid, the model objects of the rows are DataRowView instances. This is why trying to bring a DataRow into view was failing. The DataGrid will now support this useful scenario in the next nightly build. Also, in you repro project you are bringing the second to last row into view instead of the very last one. Line 237 in LargeDataTable.cs. Make sure this is not a bug in your real application too. Jason Fauchelle |
|
|
Thanks a lot, Jason. But I found another problem here, and this has nothing to do with DataTable or DataView. It is a binding list: Now I want to set the it inside of my derived DataGrid, CMostplusDataGrid on the function and want to use BringRowIntoView with my current record as in function:
Since in the testing project, the CurrentRecord is my last row, but it does not work. Scenery #1 : Steps: 0) Comment out lines from 200 to 203 on CmostPlusDataGrid.cs 1) Run the application 2) Click on Add Row button, until more records than the window can show You can see the current record is not in view. Scenery #2: Interesting factor: 0) Comment out line 193 and uncomment lines 200-203 1) Run the application 2) Click on Add Row button, until more records than the window can show The new record (last record) will be half show, 3) If you resize the window so it can show the exactly number (i.e.2, 3 4, ..., but not 2.1, 3.4 rows))of rows for datagrid, then last record can be shown Scenery #3: If you uncomment lines 195--198, comment out 200-204 and line 193, it is the same behaviour as in Scenery #1. We really want to have Scenery #1 to work. Can you fix them? Thanks Gordon |
|
|
Thanks for the repro Gordon This issue was being caused by your code overriding some of the DataGrids behavior before it was able to update the displayed items source. This meant when you call BringRowIntoView, it couldn't find the new item because the internal items source was not update yet. This issue will be resolved in the next nightly build, and you will not need to make any changes to your code. (#1 will now work). Jason Fauchelle |
|
|
Thanks Jason. I also made some changes on my code to make it work and I should have told you earlier, but these a few days I am crasily busy for iteration meetings:
I will try your new lib tomorrow when it is available. Gordon |
|
|
Thanks for the update! You should not need to use the dispatcher trick once the next nightly build is available. Jason Fauchelle |
|