Telerik Forums
UI for WPF Forum
1 answer
418 views

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>
 

Ivan Ivanov
Telerik team
 answered on 02 Mar 2016
1 answer
163 views

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
03.    x:Class="chartTest.MainWindow"
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

Ivan Ivanov
Telerik team
 answered on 02 Mar 2016
1 answer
97 views

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? 

 

 

Svetoslav
Telerik team
 answered on 02 Mar 2016
4 answers
225 views

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,

Stefan Nenchev
Telerik team
 answered on 02 Mar 2016
6 answers
223 views
I have attached an example which is 100% the First Look GanttView reduced to illustrate the problem I am experiencing.  The Fist Look works fine, my code is clearly missing something.

1. Run the app.
2. Make the Window wider.
3. Zoom all the way to 0 - you will notice now that the GanttView only takes about 1/2 the width of the window.
4. Zoom all the way to 100 - you will notice the GanttView does zoom in, but the width of th eGanttView stays the same.
5a. Make the Window wider  - the GanttView properly re-sizes  to fill the entire window.
5b Scroll the GanttView Horizontally - the GanttView properly re-sizes to fill the entire window.

The Fist Look works does not have the behavior.  The First Look does not also zoom out to where the GanttView does not fill the entire window.  I believe I'm missing something that sets a minimum zoom limit to keep this odd behavior from happening.

Ok, so apparently I can't attach a sample project .zip.  Strange.  How would you like me to send you this sample project?

Thanks,
Mike
Ben
Top achievements
Rank 1
 answered on 02 Mar 2016
1 answer
278 views

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");
}

 

 

Stefan
Telerik team
 answered on 02 Mar 2016
1 answer
80 views

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.

      

 

Stefan
Telerik team
 answered on 02 Mar 2016
3 answers
191 views

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

 
 

Martin
Telerik team
 answered on 02 Mar 2016
9 answers
203 views
On some machines showing a window with a RadPaneGroup that does not contain any Panes throws a ArgumentNullException.

On my dev workstation the window shows fine. The same windows crashes on my dev notebook.
No version differences: I can reproduce the crash by copying the bin directory to the notebook and starting the exe.

As a workaround I created a dummy pane in XAML and remove it in the _Loaded event.
EDIT: This workaround does not help. IsHidden for the dummyPane does not work too.

<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>

System.ArgumentNullException was unhandled by user code
  HResult=-2147467261
  Message=Value cannot be null.
Parameter name: collection
  ParamName=collection
  Source=mscorlib
  StackTrace:
       at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
       at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
       at Telerik.Windows.Controls.RadTabControlAutomationPeer.GetChildrenCore() in c:\TB\135\WPF_Scrum\Release_WPF\Sources

\Development\Controls\Navigation\TabControl\RadTabControlAutomationPeer.cs:line 194
       at System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
       at System.Windows.Automation.Peers.AutomationPeer.UpdateChildrenInternal(Int32 invalidateLimit)
       at System.Windows.Automation.Peers.ItemsControlAutomationPeer.UpdateChildren()
       at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
       at System.Windows.ContextLayoutManager.fireAutomationEvents()
       at System.Windows.ContextLayoutManager.UpdateLayout()
       at System.Windows.UIElement.UpdateLayout()
       at System.Windows.Interop.HwndSource.Process_WM_SIZE(UIElement rootUIElement, IntPtr hwnd, WindowMessage msg, IntPtr

wParam, IntPtr lParam)
       at System.Windows.Interop.HwndSource.LayoutFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean&

handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs,

Delegate catchHandler)
  InnerException:

Georgi
Telerik team
 answered on 02 Mar 2016
1 answer
601 views

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!

Stefan
Telerik team
 answered on 02 Mar 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?