This question is locked. New answers and comments are not allowed.
I have a RadGridView control, in which some of the items are expandable. Some of these expanded items may have several hundred child elements. I want to have the expanded item list have a scroll bar and use row virtualization. Here is the code that I am using to handle the DataLoading event on the grid.
void AssignedNumbersGrid_DataLoading(object sender, GridViewDataLoadingEventArgs e)
{
GridViewDataControl dataControl = (GridViewDataControl)sender;
if (dataControl.ParentRow != null)
{
dataControl.ShowGroupPanel = false;
dataControl.AutoGenerateColumns = false;
dataControl.CanUserFreezeColumns = false;
dataControl.IsReadOnly = true;
dataControl.SelectionMode = System.Windows.Controls.SelectionMode.Extended;
dataControl.IsFilteringAllowed = false;
dataControl.ShowInsertRow = false;
dataControl.RowIndicatorVisibility = Visibility.Collapsed;
dataControl.ChildTableDefinitions.Clear();
dataControl.Margin = new Thickness(0, 0, 0, 0);
dataControl.EnableRowVirtualization = true;
dataControl.MaxHeight = 100;
ScrollViewer.SetVerticalScrollBarVisibility(dataControl, ScrollBarVisibility.Auto);
dataControl.Columns.Add(BuildSelectColumn());
dataControl.Columns.Add(BuildNewColumn("Range Number", "DisplayAssociatedInfo"));
dataControl.Columns.Add(BuildTypeColumn());
dataControl.Columns.Add(BuildRemarkColumn());
dataControl.Columns.Add(BuildNewColumn("Status", "DisplayStatus"));
}
}
This works, but the scroll bar does not show up. If I take out the MaxHeight, then the whole thing expands and scrolls in the context of the parent but is extremely slow when there are more than a handful of elements. Some of my expanding items will have 300-2000 elements. How can I get the scrollbar and virtualization to work on the expanded children?
The methods BuildxxxColumn above are just helpers to build out the columns for the child grid.
void AssignedNumbersGrid_DataLoading(object sender, GridViewDataLoadingEventArgs e)
{
GridViewDataControl dataControl = (GridViewDataControl)sender;
if (dataControl.ParentRow != null)
{
dataControl.ShowGroupPanel = false;
dataControl.AutoGenerateColumns = false;
dataControl.CanUserFreezeColumns = false;
dataControl.IsReadOnly = true;
dataControl.SelectionMode = System.Windows.Controls.SelectionMode.Extended;
dataControl.IsFilteringAllowed = false;
dataControl.ShowInsertRow = false;
dataControl.RowIndicatorVisibility = Visibility.Collapsed;
dataControl.ChildTableDefinitions.Clear();
dataControl.Margin = new Thickness(0, 0, 0, 0);
dataControl.EnableRowVirtualization = true;
dataControl.MaxHeight = 100;
ScrollViewer.SetVerticalScrollBarVisibility(dataControl, ScrollBarVisibility.Auto);
dataControl.Columns.Add(BuildSelectColumn());
dataControl.Columns.Add(BuildNewColumn("Range Number", "DisplayAssociatedInfo"));
dataControl.Columns.Add(BuildTypeColumn());
dataControl.Columns.Add(BuildRemarkColumn());
dataControl.Columns.Add(BuildNewColumn("Status", "DisplayStatus"));
}
}
This works, but the scroll bar does not show up. If I take out the MaxHeight, then the whole thing expands and scrolls in the context of the parent but is extremely slow when there are more than a handful of elements. Some of my expanding items will have 300-2000 elements. How can I get the scrollbar and virtualization to work on the expanded children?
The methods BuildxxxColumn above are just helpers to build out the columns for the child grid.