We are encountering an issue where the UI with a Grid View in it freezes when you scroll the grid sideways a certain amount.
We are using nested column grouping in order to display a set of "calculated" values above the existing columns. The calculated values are displayed by setting the column group header template and binding to the fields on the control ancestor's data model.
The issue is, this worked perfectly fine with v2012.3.1129.40 . The grid would scroll across fine with very little slowdown.
Now with v2015.2.728.45 the grid starts off scrolling normally, but quickly stutters and eventually grinds to a completely unresponsive halt.
EnableColumnGroupsVirtualization is set to false because otherwise the middle nested column group headers do not show up at all (a separate issue I can reproduce in another forum thread if need be).
I have a project that can reproduce this but it doesn't seem like I'm allowed to attach it.
Essentially it is a grid with a number of grid column groups (50+) defined as follows, and simple GridViewColumns set to the innermost column group.
<
telerik:RadGridView.ColumnGroups
>
<
telerik:GridViewColumnGroup
Name
=
"Outermost Group"
Header
=
"Outermost Group"
>
<
telerik:GridViewColumnGroup
Name
=
"Inner1_1"
Header
=
"Inner1_1"
>
<
telerik:GridViewColumnGroup.HeaderTemplate
>
<
DataTemplate
>
<
TextBlock
HorizontalAlignment
=
"Center"
Text
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ChartTest:MainWindow}, Path=DataContext[1]}"
/>
</
DataTemplate
>
</
telerik:GridViewColumnGroup.HeaderTemplate
>
<
telerik:GridViewColumnGroup
Name
=
"Inner1_2"
Header
=
"Inner1_2"
>
<
telerik:GridViewColumnGroup.HeaderTemplate
>
<
DataTemplate
>
<
TextBlock
HorizontalAlignment
=
"Center"
Text
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ChartTest:MainWindow}, Path=DataContext[1]}"
/>
</
DataTemplate
>
</
telerik:GridViewColumnGroup.HeaderTemplate
>
<
telerik:GridViewColumnGroup
Name
=
"Inner1_3"
Header
=
"Inner1_3"
>
<
telerik:GridViewColumnGroup.HeaderTemplate
>
<
DataTemplate
>
<
TextBlock
HorizontalAlignment
=
"Center"
Text
=
"{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ChartTest:MainWindow}, Path=DataContext[1]}"
/>
</
DataTemplate
>
</
telerik:GridViewColumnGroup.HeaderTemplate
>
</
telerik:GridViewColumnGroup
>
</
telerik:GridViewColumnGroup
>
</
telerik:GridViewColumnGroup
>
</
telerik:GridViewColumnGroup
>
</
telerik:GridViewColumnGroups
>
Known affected versions: 2015.2.728, 2016.1.217, both net40 and net45
There appears to be a bug in the CommonHeaderPresenter VirtualizingStrategy when there are more than 2 levels of nested column groups.
The following code shows the bug in effect. When EnableColumnGroupsVirtualization is True, the Middle 2 group headers are not displayed. Only the outermost group (not referenced by any column) and the innermost group (referenced by the single column) are visible. (Also see attached image for demonstration)
01.
<
Window
02.
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
03.
x:Class
=
"chartTest.MainWindow"
05.
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
06.
xmlns:d
=
"http://schemas.microsoft.com/expression/blend/2008"
07.
xmlns:mc
=
"http://schemas.openxmlformats.org/markup-compatibility/2006"
08.
mc:Ignorable
=
"d"
09.
Title
=
"MainWindow"
10.
Height
=
"350"
11.
Width
=
"525"
>
12.
<
telerik:RadGridView
13.
AutoGenerateColumns
=
"False"
14.
CanUserDeleteRows
=
"False"
15.
CanUserSortColumns
=
"False"
16.
CanUserResizeColumns
=
"False"
17.
CanUserReorderColumns
=
"False"
18.
CanUserResizeRows
=
"False"
19.
CanUserFreezeColumns
=
"False"
20.
CanUserInsertRows
=
"False"
21.
CanUserSelect
=
"True"
22.
CanUserSortGroups
=
"False"
23.
ShowGroupPanel
=
"False"
24.
NewRowPosition
=
"None"
25.
ShowColumnFooters
=
"False"
26.
RowIndicatorVisibility
=
"Collapsed"
27.
EnableColumnGroupsVirtualization
=
"True"
>
28.
<!-- Switch EnableColumnGroupsVirtualization between True and False to see the bug -->
29.
<
telerik:RadGridView.ColumnGroups
>
30.
<
telerik:GridViewColumnGroup
31.
Name
=
"Outermost Group"
32.
Header
=
"Outermost Group"
>
33.
<!-- These 2 middle groups do not show up when virtualization is used -->
34.
<
telerik:GridViewColumnGroup
35.
Name
=
"Middle 1 Group"
36.
Header
=
"Middle 1 Group"
>
37.
<
telerik:GridViewColumnGroup
38.
Name
=
"Middle 2 Group"
39.
Header
=
"Middle 2 Group"
>
40.
<
telerik:GridViewColumnGroup
41.
Name
=
"Innermost Group"
42.
Header
=
"Innermost Group"
>
43.
</
telerik:GridViewColumnGroup
>
44.
</
telerik:GridViewColumnGroup
>
45.
</
telerik:GridViewColumnGroup
>
46.
</
telerik:GridViewColumnGroup
>
47.
</
telerik:RadGridView.ColumnGroups
>
48.
<
telerik:RadGridView.Columns
>
49.
<
telerik:GridViewColumn
50.
Width
=
"150"
51.
ColumnGroupName
=
"Innermost Group"
/>
52.
</
telerik:RadGridView.Columns
>
53.
</
telerik:RadGridView
>
54.
</
Window
>
I have tracked it down to the InitializeVisuals() method on VirtualizingStrategy (Controls\GridView\GridView\GridView\ColumnGroups\CommonHeaderPresenter.VirtualizingStrategy.cs).
At around line 69 it traverses the column groups for the current column group, and sets each child control's ParentGroup property to the TOP LEVEL (outermost) column group. Thus all child groups at all levels are flattened out as they are made direct children of the first level of column groups:
01.
foreach
(var columnGroup
in
ParentPresenter.ColumnGroups)
02.
{
03.
...
04.
05.
this
.TraverseColumnGroups(columnGroup,
06.
new
Action<GridViewColumnGroup>((c) =>
07.
{
08.
if
(!
this
.GroupNames.Contains(c.Name))
09.
{
10.
this
.GroupNames.Add(c.Name);
11.
c.ParentGroup = columnGroup;
12.
c.DataControl = columnGroup.DataControl;
13.
}
14.
}));
15.
}
I have managed to fix this by creating an overload for TraverseColumnGroups which takes an action which can act on both the Parent AND Child groups. Using this new action in the traversal from above results in the inner column group headers actually showing up in the test code from above.
The changes I had to make can be seen below (unrelated code excluded):
01.
internal
void
TraverseColumnGroups(GridViewColumnGroup group, Action<GridViewColumnGroup, GridViewColumnGroup> action)
02.
{
03.
foreach
(var childGroup
in
group.ChildGroups)
04.
{
05.
action.Invoke(group, childGroup);
06.
this
.TraverseColumnGroups(childGroup, action);
07.
}
08.
}
09.
10.
...
11.
12.
foreach
(var columnGroup
in
ParentPresenter.ColumnGroups)
13.
{
14.
...
15.
16.
this
.TraverseColumnGroups(columnGroup,
17.
new
Action<GridViewColumnGroup, GridViewColumnGroup>((parentGroup, childGroup) =>
18.
{
19.
if
(!
this
.GroupNames.Contains(childGroup.Name))
20.
{
21.
this
.GroupNames.Add(childGroup.Name);
22.
childGroup.ParentGroup = parentGroup;
23.
childGroup.DataControl = parentGroup.DataControl;
24.
}
25.
}));
26.
}
I'm assuming this bug is not "works as designed", because why would only the OUTERMOST\First level column group header show up (even if it isn't directly referenced by any columns).
Thanks,
Sam
Hi, at the moment I create a document using richtextbox with some merge fields. I then save the document as a .xaml so the file can be reused over and over. I convert the file from my database and import it using the code below
private void OpenTemplate()
{
if (Attachments.SelectedItem != null)
{
var template = (FilesDTO) Attachments.SelectedItem;
RadDocument result;
var UnitOfWork = new UnitOfWork();
XamlFormatProvider provider = new XamlFormatProvider();
result = provider.Import(UnitOfWork.MailTemplateRepository.GetById(template.Id).FileXAML);
radRichTextBox.Document = result;
}
}
After opening the file, I then populate the
radRichTextBox.Document.MailMergeDataSource.ItemsSource = UniversalCollection;
When loading a .xaml document, the mailing tab buttons behave weird. If I were to press any button [show all field codes, preview result, previous, next] it will jump to the Home tab instead of maintaining on the mailings tab.
It works completely fine if I don't open a xaml document. Am I missing something upon importing?
Hi,
I have a GridView for a DesktopAlert. It is like the example in your demos.
I have used the RowStyleSelector from the example. The properties "FontWeight" and "Background" work succesfull, however the property "Foreground" doesn't work. The color of text of the row is not changing.
The code:
<
UserControl.Resources
>
<
localStyleSelector:MessageRowStyleSelector
x:Key
=
"RowStyleSelector"
>
<
localStyleSelector:MessageRowStyleSelector.BoldStyle
>
<
Style
TargetType
=
"{x:Type telerik:GridViewRow}"
BasedOn
=
"{StaticResource GridViewRowStyle}"
>
<
Setter
Property
=
"FontWeight"
Value
=
"Bold"
/>
<
Setter
Property
=
"Background"
Value
=
"#FF9EAABF"
/>
<
Setter
Property
=
"Background"
Value
=
"Red"
/>
</
Style
>
</
localStyleSelector:MessageRowStyleSelector.BoldStyle
>
<
localStyleSelector:MessageRowStyleSelector.NormalStyle
>
<
Style
TargetType
=
"{x:Type telerik:GridViewRow}"
BasedOn
=
"{StaticResource GridViewRowStyle}"
/>
</
localStyleSelector:MessageRowStyleSelector.NormalStyle
>
</
localStyleSelector:MessageRowStyleSelector
>
<
localConverter:NullToVisibilityConverter
x:Key
=
"NullToVisibilityConverter"
/>
</
UserControl.Resources
>
<
telerik:RadGridView
x:Name
=
"gwMessages"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
Grid.Row
=
"1"
Grid.Column
=
"0"
ShowGroupPanel
=
"False"
SelectionChanged
=
"OnGridViewSelectionChanged"
ItemsSource
=
"{Binding ReceivedMessagesCollection}"
SelectedItem
=
"{Binding SelectedMessage, Mode=TwoWay}"
IsSynchronizedWithCurrentItem
=
"True"
RowStyleSelector
=
"{StaticResource RowStyleSelector}"
GroupRenderMode
=
"Flat"
AutoExpandGroups
=
"True"
AutoGenerateColumns
=
"False"
RowIndicatorVisibility
=
"Collapsed"
CanUserFreezeColumns
=
"False"
IsReadOnly
=
"True"
ColumnWidth
=
"*"
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
>
<
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:EventBinding
Command
=
"{Binding ContextMenuOpenedCommand}"
EventName
=
"Opened"
PassEventArgsToCommand
=
"True"
/>
</
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:RadMenuItem
Header
=
"Reply"
/>
<
telerik:RadMenuItem
Header
=
"Reply All"
/>
<
telerik:RadMenuItem
Header
=
"Forward"
/>
<
telerik:RadMenuItem
IsSeparator
=
"True"
/>
<
telerik:RadMenuItem
Header
=
"Mark as Unread"
Command
=
"{Binding MarkAsUnread_ContextMenuCommand}"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"From"
DataMemberBinding
=
"{Binding Sender}"
/>
<
telerik:GridViewDataColumn
Header
=
"Subject"
DataMemberBinding
=
"{Binding Subject}"
/>
<
telerik:GridViewDataColumn
Header
=
"Received"
DataMemberBinding
=
"{Binding Received}"
DataFormatString
=
" {0:dd/MM/yyyy hh:mm}"
/>
<
telerik:GridViewDataColumn
Header
=
"ReceivedDate"
DataMemberBinding
=
"{Binding ReceivedDate}"
IsVisible
=
"False"
GroupHeaderFormatString
=
" {0:dd/MM/yyyy}"
DataFormatString
=
" {0:dd/MM/yyyy}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
Any help?
Thanks,
We have a standard WPF MVVM project. In one view model we have a QueryableCollectionView to which a radgridview is bound. When the user filters the grid we had expected the QueryableCollectionView.FilterDescriptors.CollectionChanged to be fired but nothing is happening. When we inspect the FilterDescriptors through visual studio we can see the collection is present. Is this binding incorrect or am I missing something else?
Any help appreciated:
DisplayTrades = new QueryableCollectionView(displayTradeSource, typeof(TradeViewModel));
DisplayTrades.FilterDescriptors.CollectionChanged += CollectionChanged_Event;
private void CollectionChanged_Event(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
throw Exception("test");
}
Hi,
I am trying to automate radgridview with 20 columns and 300 rows using CUIT/UIA. Here the script is unable to get the required row and cell in to view (auto scroll not working). If the row is visible it is able to perform action. We didn't implemented any virtualization on the RADgridview.Any help in this regard is very much thankful.
Please reply as early as possible as it is very high priority issue.
Regards,
Nagasree.
Hi,
I am using Calculator picker independently without binding its value with any property. I am trying to resets its value after user completes its calculation from the calculator and press save button in the window. I am resetting its value in code behind like "this.CalculatorPicker.Value = 0". On display of the calculator picker it resets the value but on Calculator itself the pervious value remains. I wanted to reset the value on both display and calculator.
Attached is the image after resetting calculator picker value.
I also tried following
this.CalculatorPicker.MemoryValue= 0
this.CalculatorPicker.CacheMode = null
But it didn't work out.
This problem happens when we tried to do some calculations like addition, subtraction, multiplication etc.
Kindly help me in this matter, I will be very thankful to you.
Thanks and Regards
Arslan
<
telerik:RadDocking
x:Name
=
"dock"
Grid.Row
=
"1"
PreviewClose
=
"dock_PreviewClose"
Close
=
"dock_Close"
>
<
telerik:RadDocking.DocumentHost
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
x:Name
=
"paneGroup"
>
<!-- Workaround for System.ArgumentNullException on Notebook -->
<
telerik:RadPane
x:Name
=
"dummyPane"
Header
=
"aaa"
CanUserPin
=
"True"
>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking.DocumentHost
>
</
telerik:RadDocking
>
Hi
Just a question. Is possible to set margin directly to image of GridViewImageColumn? Something like:
<
telerik:GridViewImageColumn
ImageMargin
=
"4"
/>
If there isn't any property for do that, Should I modify datatemplate for apply it?
Thank you! Regards!