Hey there,Just noticed that XamDataGrid seems to ignore the MaxHeight property on it's RowDefinition, it works perfectly fine with the Height property though. Why is XamDataGrid using the Height and not the ActualHeight property of the RowDefinition?Below you'll find a small test scenario. The ScrollViewer is needed because we use it in our application. The first XamDataGrid is what we want, but doesn't seem to work. The XamDataGrid just expands behind the MaxHeight and thus loading every record in memory. The second XamDataGrid is working the way we want it to, but is using the Height property. Is there anything I can do to use the MaxHeight?
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <Grid> <Grid.RowDefinitions> <RowDefinition MaxHeight="100" /> </Grid.RowDefinitions> <igDP:XamDataGrid BindToSampleData="True" /> </Grid> <Grid Grid.Row="1"> <Grid.RowDefinitions> <RowDefinition Height="100" /> </Grid.RowDefinitions> <igDP:XamDataGrid BindToSampleData="True" /> </Grid> </Grid></ScrollViewer>Thanks,Wim
I understand, your explanation was pretty clear. :)Thanks for the help!Wim
Hello Wim,
I see what you mean, but this is actually a WPF limitation. It all comes to setting an actual value for your container’s Height property since the ScrollViewer needs the container and the scrolled visual’s Heights in order to show valid ScrollBars. When you have a container (your RowDefinition) with a Height=”*” (the default value for this control) the ScrollViewer cannot access all the measurements it needs. Excuse me if I am not explaining this clear enough, but you can double check this with some simpler controls. You can replace the XamDataGrids in your sample with this:
<ScrollViewer>
<Ellipse Fill="BlueViolet" Height="200" Width="350" />
</ScrollViewe
What I can suggest is you reorganize your VisualTree in order to provide the necessary conditions for the ScrollViewers to work.
Hope this helps. Please let me know if I can assist you any further on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Hey Petar,Thanks for the fast reply. This shows exactly what I ment with my example, the purple XamDataGrid has no ScrollBar but grows behind it's MaxHeight. Select a record in the grid and press your arrow key down.Guess it's not the MaxHeight that's causing this, since the XamDataGrid does have the correct height. Can I fix the not showing scrollbar somehow? I know I can force it to show the scrollbar, but that would be pointless, since the XamDataGrid grows to a size that doesn't need a scrollbar...
Greetings,Wim
I looked into this and everything seems to work ok. Perhaps it will be easier for you to observe the bounds of the controls if you were to set some Margins and color them like so:
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid Background="Red" Margin="2">
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Grid Background="YellowGreen" Margin="5">
<RowDefinition MaxHeight="100" />
<igDP:XamDataGrid BindToSampleData="True" Background="BlueViolet" Margin="5" />
</Grid>
<Grid Grid.Row="1" Background="Yellow" Margin="5">
<RowDefinition Height="100" />
<igDP:XamDataGrid BindToSampleData="True" Background="Aqua" Margin="5" />
</ScrollViewer>
Please let me know if you require any further assistance on the matter.