I wrote a custom virtual fixed height custom panel. Works great! However I have very wide rows with a lot of data. So I'm having to virtualize the rows as well. I'm not sure the best way to forward horizontal scroll events to the child virtual panel.
Parent Vertical template
<ItemsControl x:Name="PART_DataRowItemsControl" VirtualizingStackPanel.VirtualizationMode="Recycling" VirtualizingStackPanel.IsVirtualizing="True" ClipToBounds="True" ItemsSource="{TemplateBinding RowData}" ScrollViewer.CanContentScroll="True"><ItemsControl.ItemsPanel><ItemsPanelTemplate><ganttChart:FixedHeightVirtualItemsPanel TimeLineIncrementType="{Binding TimeLineIncrementType}" StartTime="{Binding StartTime}" EndTime="{Binding EndTime}" PixelsBetweenTimeIncrements="{Binding PixelsBetweenTimeIncrements}" RowHeight="{Binding DataContext.RowHeight, ElementName=PART_DataRowItemsControl}" /></ItemsPanelTemplate></ItemsControl.ItemsPanel><ItemsControl.Template><ControlTemplate><Border BorderThickness="{TemplateBinding Border.BorderThickness}" Padding="{TemplateBinding Control.Padding}" BorderBrush="{TemplateBinding Border.BorderBrush}" Background="{TemplateBinding Panel.Background}" SnapsToDevicePixels="True"><ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" Padding="{TemplateBinding Control.Padding}" Focusable="False"><ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" /></ScrollViewer></Border></ControlTemplate></ItemsControl.Template></ItemsControl>
Horizontal Template
<ganttChart:GanttRowItemDisplay Visibility="{Binding DisplayDetails, Converter={StaticResource InvertedBooleanToVisibilityConverter}}" NumRows="{Binding NumRows}" StartTime="{Binding StartTime}" EndTime="{Binding EndTime}" ItemsSource="{Binding RowItems}"><ganttChart:GanttRowItemDisplay.ItemsPanel><ItemsPanelTemplate><ganttChart:GanttRowItemPanel RowHeight="{Binding RowHeight}" TimeLineIncrementType="{Binding TimeLineIncrementType}" StartTime="{Binding StartTime}" EndTime="{Binding EndTime}" PixelsBetweenTimeIncrements="{Binding PixelsBetweenTimeIncrements}" /></ItemsPanelTemplate></ganttChart:GanttRowItemDisplay.ItemsPanel></ganttChart:GanttRowItemDisplay>
The custom items controls are for drag and drop. The vertical has one as well, but I made it a standard items control for testing.
The previous iteration of this control didn't have virtualization of the horizontal rows so the horizontal scrolling of the parent wasn't a problem, but now since the panels are in control of scrolling I have no way of showing more than the viewport width without somehow telling the child panels to scroll horizontal. I've achieved this using a behavior I grabbed from somewhere off the web for keeping the row headers in separate columns of items controls sync'ed but the templates are in separate files for this. I'm guessing there's a way to forward scroll events from the setHorizontal offset handler in the top panel, but not sure how to do that. Please help!