Hi, I am using XAMDataGrid inside stack pnale along with few other childs. when there are multiple items in xamdatagrid vertical scrollviewer not displaying even I have made
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto". please suggest.
Regards
Hitesh
Hello Hitesh,
Thank you for your support request.
I created a sample application based on your scenario and I could not managed to reproduce the behavior that you have described. If you are not able to reproduce the issue with the attached sample application, would you please modify it with the functionality, that you are using, so it reproduces the issue.
Would you please provide me with more detailed information regarding the environment in which you are developing your application (Operating system, Service Release, Integrated development environment and the specific version of our product that you are using and any other information that might help reproducing your issue), in order to be able to identify what might be causing this behavior?
This way I would be able to further investigate this for you and provide you with more detailed information on this matter.
Looking forward to hearing from you.
Hi,
Thanks for your post. in your example if you increase number of lines i.e.
new Item("item1"),
new Item("item2"),
new Item("item3"),
new Item("item4"),
new Item("item5"),
new Item("item6"), multiple times in constructor and decrese height of window to some 400 , then it won't show vertical scrollbar.
I am able to get scrollbar now by using scrollviewer outside stackpanel but another issue facing, scrollviewer moveing bottomwards and hide , I need to stop it from getting hidden.
The behavior with scrollbar is happening because a StackPanel will measure its children with infinity in the direction of the orientation. The children are measured with an infinite height and then arranged with that height. So a list control like a grid will be as tall as needed to show all their children. If those children happen to be taller than the containing StackPanel then they will just be clipped.
The XamDataGrid will automatically place a ScrollViewer around its content, unless it is placed as in your scenario in an infinity container, like a StackPanel, so in order to avoid the behavior about vertical scrollbar, I can suggest to set the HeightInInfiniteContainers property of VewSettings class in XamDataGrid to some default height instead of using ScrollViewer.
You can read more details about HeightInInfiniteContainers property from the following link from our online documentation:
http://help.infragistics.com/doc/WPF/2016.1/CLR4.0/?page=InfragisticsWPF4.DataPresenter.v16.1~Infragistics.Windows.DataPresenter.GridViewSettings~HeightInInfiniteContainers.html
From this forum thread you read more details about why is better to use HeightInInfiniteContainers property instead of inserting XamDataGrid within ScrollViewer:
http://es.infragistics.com/community/forums/t/38712.aspx
I have attached simple sample application in order to show you how you can implement my suggestion and achieve your goal.
Please let me know if you have any questions regarding this matter.
Sincerely, ZhivkoEntry Level Software Developer
Hi Zhivko,
Thanks for response. it's working fine now after making above changes. Thanks again for your help.
Thank you for your feedback.
I am very glad that you have manage to resolve your issue. If you require any further assistance on the matter, please do not hesitate to let me know.