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 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.
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.
Thanks alot!! It worked so smooth.
Thank you for your feedback.
Did you try to save a reference to the first expanded row? Did you try to set the FirstRow of the RowScrollRegion to the first expanded row?
This should scroll to the first expanded row. Please check the attached sample solution where I have implemented a method ScrollToFirstExpandedRow. When you call this method it scrolls to the first expanded row, activate it and select it.
Please note that if only the last row is expanded and you try to scroll to it by default last row will not go to the top of the scroll region. In order to add some free space in scroll region under the last row you can set the ScrollBounds property of the DisplayLayout to ScrollToLastItem. More about ScrollBounds 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.ScrollBounds.html
If my sample is not accurate demonstration of what you are trying to achieve please fill free to modified and send it back to me, or if you can provide me your own sample demonstrating this behavior.
Looking forward to your reply.
Thank you for your support.
The solution for the above problem is not found. I tried with what you explained in the previous replies.
In the above post i have sent the screenshots for more understanding. Let me know if you require some more information
Please find the attched screenshots.
In the attached folder, there are two images.
Consider my initial layout structure is as shown in the screenshot (Before.png)
When i go to someother windo, i will be saving this information in an xml file as explained previously.
And when i return back to same window, it should appear as shown in the After.png (the first expanded UltraGridGroupByRow to be at the top of the scroll screen).
I guess its more clear with screenshots.
I am just checking about the progress of this issue. Let me know if you need my further assistance on it.
Thank you for using Infragistics Components.