Hello,
in my xamPropertyGrid I want to keep the postion of the scrollbar, when I assign a new object to the SelectedObject property. I have some objects of the same type I want to view, and when I select another object I want that the scroll bar is on the same position as the prior one in order I can investigate the values more easily.
Hello Markus,
After investigating the described functionality – showing the XamPropertyGrid’s content after a new scrolling position is set, has been determined to be a product idea. You can suggest new product ideas for future versions by emailing ideas@infragistics.com
Submitting your idea will send it directly to our product management team so that it can be imported into our new ideas community once live: http://ideas.infragistics.com
Remember when submitting your idea to explain the context in which a feature would be used and why it is needed as well as anything that would prevent you from accomplishing this today. You can even add screenshots to build a stronger case. You can also link back to this thread for additional details.Thank you in advance to submitting your product idea.
This solution is not very elegant, but it works somehow.
I always see a flickering, when I set the new scrollbar postion. I mean, at the first moment the scrollbar is at Position=0 then you see how the scrollbar position was changed.
Is it possible to just show the content, after the new postion was set, to avoid flickering?
Thank you for the feedback and the code you have provided.
Applying the theme will set an additional scrollbar which in the current scenario will have an ActualWidth which is 0 and is the one you are referring to. To get the ScrollBar which value should be changed you will have to use GetDescendantFromType and use a callback function to check for the correct ScrollBar.
I have created a small application using this approach.
Note that in this scenario - Setting the ScrollBar's Value in SelectedObjectsChanged, you will need a Dispatcher to set it after the change has been performed.
using the Scrollbar.Value is always 0. Also when I set that value it still contains 0. Here is my code:
ScrollBar scrollbar = Infragistics.Windows.Utilities.GetDescendantFromName(propGrid, "PART_VerticalScrollBar") as ScrollBar;
double val = scrollbar.Value; //is always 0
scrollbar.Value = 200; //remains 0
I am using the DarkMetro theme.
You can modify the scroll in the XamPropertyGrid by using the Infragistics.Windows.Utilities class and its static method GetDescendantFromName. Using this method, you can obtain the vertical scrollbar from your XamPropertyGrid. This scrollbar has the name "PART_VerticalScrollBar," and by incrementing its value property, you should be able to create a scrolling behavior in the XamPropertyGrid.