<igDock:XamDockManager> <igDock:XamDockManager.Panes> <igDock:SplitPane> <igDock:ContentPane> <StackPanel Height="300"> <Button>MyButton</Button> <igData:XamDataPresenter>
I have a situation similar to the above where I have a Button and a XamDataPresenter together on a dockable pane. However, with this arrangement, if the records displayed in the XamDataPresenter are more than the height of the pane, no vertical scroll bar appears on the right of the XamDataPresenter. I figured to use a Grid instead of a StackPanel to fix this from here: http://karlshifflett.wordpress.com/category/uncategorized/
But this presents a couple of problems. 1) The Button disappears, and 2) if I undock the pane and make it vertically bigger, the XamDataPresenter doesn't stretch to fill the size of the pane. If I remove the Height attribute from the Grid, its height becomes as big as required to display all records and the pane matches that size even when initially docked, thus resulting in the pane exceeding the size of the browser window and/or screen.
Is it possible to use a StackPanel without the vertical scroll bar disappearing? And in either case, how can I ensure the XamDataPresenter always stretches to the size of the pane but setting the pane to a maximum initial size (so it doesn't stretch to an excessive size just to match the XamDataPresenter displaying all records)?
Many thanks,Jason
Hello Jason,
On a quick view I solved some of the problems with the grid -- if you define RowDefinitions of the grid the button will not disappear and there will be a scrollbar visible like this:
<Grid Height="300"> <Grid.RowDefinitions> <RowDefinition Height="*"/> <RowDefinition Height="5*"/> </Grid.RowDefinitions> <Button Grid.Row="0">MyButton</Button> <igDP:XamDataPresenter Grid.Row="1" Name="presenter" /> </Grid>
but I am not sure why XamDockManager's behavior is strange with the StackPanel.
Alex.
Thanks Alex. I figured the problem with the button disappearing would be easily resolvable by setting Heights explicitly. Thanks for your help with that.
But, the main problem is if I undock the pane and make it vertically bigger, the XamDataPresenter doesn't stretch to fill the size of the pane while Grid Height="300". If I remove this Height attribute from the Grid, the XamDataPresenter stretches as big as required to display all records and the pane matches that size even when initially docked, thus resulting in the pane exceeding the size of the browser window and/or screen upon start-up.
So, I need to find a way to ensure that the XamDataPresenter always stretches to the size of the pane but set the pane to a maximum initial size (such as "300" so it doesn't stretch to an excessive size just to match the XamDataPresenter displaying all records).
Any ideas much appreciated on this.
Thanks,
Jason