Hi,
I have an hierarchical grid in ScrollViewer and grid has many rows. When I press the expand indicator, 2 scrollbars appear; one for the ScrollViewer which is the parent of the Grid and one for XamDataGrid itself whereas the grid should not display the scrollbar as it is inside the ScrollViewer which gives its children infinite space to exist in.
Please can someone help me to resolve this issue? Is this a bug? I am using the latest version of Infragistics NetAdvantage for WPF 8.2.
Thanks in advance.
Adeel
Hi Adeel,
I have come across the same problem, whereby I am creating a document containing multiple 'widgets' - of which a XamDataGrid is one. The document itself is a ScrollViewer, to allow you to scroll up and down, the same as MS Word.
The problem lies in turning off the XamDataGrids built in vertical scrolling - I would like it's height to be the full height of all the rows it contains. One pre-requisite to achieving this is to ensure all row containers are generated at startup, as I assume the reuse of containers would only work with it's in-built ScrollViewer.
Saying that, I've been trying to get this to work for an hour or two now and haven't really got anywhere. I have been playing with the templates for the XamDataGrid and RecordListControl (that contains the in-built ScrollViewer), adjusting various properties, adding in a StackPanel etc.. but can't yet get the desired behaviour.
If anyone has any suggestions or has got this to work, it would be very useful, as I'll have to return to this at some point.
Regards,
Dave.
This will shut off the scroll bars in the grid...
<igDP:XamDataGrid.Resources>
<Style TargetType="{x:Type igDP:RecordListControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type igDP:RecordListControl}">
<ScrollViewer CanContentScroll="False" Focusable="False" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled">
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</igDP:XamDataGrid.Resources>
Hi JFelton,
Sure, that template does turn off the scroll bars - unfortunately it doesn't make the XamDataGrid's height expand to the full height of all its contained rows. Like a StackPanel, we require the grid to "grow" vertically, when rows are added.
I've used the above template (and tried removing the ScrollViewer from it completely as well), in conjunction with setting the following properties:
I'm trying to get the grid to generate all records, cells, labels etc at startup - I'm trying to turn off all lazy-load, recycling abilities. Have I missed another property somewhere I need to set?
This method sort of works upto a point... upto 43 rows to be exact. I've made a simple test project with the following xaml placed in a Window:
<ScrollViewer VerticalScrollBarVisibility="Visible">
<igDP:XamDataGrid x:Name="TestGrid" Margin="5">
<ItemsPresenter />
</igDP:XamDataGrid>
I'm adding 100 rows in code behind:
Me.TestGrid.DataItems.Add("This is a test data item " & index.ToString)
Next index
When I run the app, the ScrollViewer containing the XamDataGrid allows me to scroll the entire grid up and down, but the grid is only tall enough to show 43 of the rows... the other rows are there, if you select row 43 and keep pressing the down arrow, it scrolls all the way to row 100 (interestingly, it doesn't go back up to the top again).
Something is still restricting the overall height of the grid - if I snoop the app, it appears there are 100 RecordListItemContainer objects all with an ActualHeight of 23.2766666, but the parent GridViewPanel objects height is only 1032.1733333.
What's limiting the height of this panel? It appears some sort of virtualization is still occurring.
Dave