Is there any way to know if a particular record is in the visible area and if it is not in viewable area, is it possible to scroll to that specific record through code?
Hello,
Yes, you can use the BringRecordIntoView method, which will bring a particular record into view if it is not visible.
You can also use the GetRecordsInView method to get all the records that are currently visible.
Please let me know if you have any more questions on this matter.
Is there a way to bring the record into view, but always have it land at the TOP of the grid (assuming you are not at the bottom, and cannot scroll any further down). The BringRecordsIntoView method sometimes results in the record being on the bottom or on the top of the grid, depending on which way the view has to "scroll" to get to the record. This is unpredictable for our users.
There are three scenario that can happen when you request a record into view:
1. The record is already into view, and nothing happens
2. The record is "above" the currently viewed records. When calling BringRecordIntoView(...) the record will be at the top.
3. The record is "below" the currently viewed records. This is the case you are interested, right? If that is the case, you can call the DataPresenterCommands.RecordPageAbove or call BringRecordIntoView for the record, which index is exactly one page of records below (this count you can get with the GetRecordIntoView method).
Alex, is there a nice way to bring a record in to vie and position it in the middle of the grid (not on top or bottom)?
You case number #3 above brings a lot of mess calling ExecuteCommand and doesn't solve the problem entirely because it activate records, etc. whereas I want simple to position scroll bar to show my record in the middle.
Thanks for advice.