Hi,
Following are the steps to consider
1. Consider there are 10 UltraGridGroupByRow rows in my layout.
2. I expanded 5th, 6th, 7th, 8th and 9th UltraGridGroupByRow row in my layout.
3. I do some operation, I go to someother screen of my application
4. When i return back to this window, I want to retain the same scroll position from which i left this window last time.
5. The scroll position should be in such a way that the first expanded UltraGridGroupByRow should be at the top of the layout.(that is, the scroll view must start from 5th row)
6. I am saving the expanded/collapsed information of the UltraGridGroupByRow in an XML file. Along with this information i want to save the scroll position.
7. "ultragrid .ActiveRowScrollRegion.ScrollPosition" is not working for me as expected.
Is there any other way of retaing the same scroll position in the layout?
Thanks in advance
Hello Sandesh,
Thank you for your feedback.
You may use same approach to retain the first expanded row on the top of the grid’s scroll region. What you need to do is save a reference to the first expanded row while you restore your saved layout. In the attached sample solution I have implemented this approach. Please note you can use again FirstRow property of the RowScrollRegion.
Please let me know if this is what you are looking for or if I am missing something.
Hi Milko,
Thanks for the response.
If I compare the sample application (which you have attached) and my application, its very much similar in storing expanded information where i store in the XML file.
Consider there are 100 UltraGridGroupByRow in my layout.
When i go to some-other window/screen and return back, the layout in the above screen should start from first expanded UltraGridGroupByRow in that layout.
That is, consider i have randomly expanded some UltraGridGroupByRow out of 100 rows
When i load the layout, the scroll region must be in a position of top most expanded UltraGridGroupByRow row.
Thank you for posting in our forum.
If I understand you correctly you need to retain the first expanded row at the top of the grid’s scroll region. In order to achieve this you may use FirstRow property of the RowScrollRegion class. When you save the layout save also the FirstRow. When you load the layout set the FirstRow property to the saved value. More about FirstRow you may find by following the next link http://help.infragistics.com/Help/Doc/WinForms/2015.1/CLR4.0/html/Infragistics4.Win.UltraWinGrid.v15.1~Infragistics.Win.UltraWinGrid.RowScrollRegion~FirstRow.html
Please check the attached sample project implementing this approach and let me know if you need any further assistance.