Telerik Forums
UI for WPF Forum
2 answers
304 views
Is it possible to have a two way binding of the text content in the editor to a string property in the View Model?
Richard
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 15 Jan 2020
1 answer
289 views

Hi,

We have a requirement to have multiple isolated work spaces in our application (which we originally planned to host in RadTabbedWindow tabs).

Each of these work spaces need to have their own RadDocking set up and be navigable.

We are using implicit datatemplates for our MVVM infrastructure and binding ContentControls to viewmodels at runtime and we are having issues with the TabControl/Window datatemplate and the RadDocking framework.

The problems we are having are as follows:
1) When we bind an ObservableCollection of ViewModels to the ItemsSource property of the RadTabControl/RadTabbedWindow and we try to set up RadDocking in the TabControl/Window's ContentTemplate, an exception gets thrown.

Here's our the code:

<telerik:RadTabControl ItemsSource="{Binding WorkspaceViewModels}"
                         x:Name="WorkspaceContainer"
                         ScrollMode="Viewport"
                         SupressSelectedContentTemplateReapplying="True"
                         IsContentPreserved="True">
    <!-- Event is only available with RadTabbedWindow
    <telerik:EventToCommandBehavior.EventBindings>
        <telerik:EventBinding EventName="AddingNewTab" Command="{Binding AddWorkspaceCommand}"/>
    </telerik:EventToCommandBehavior.EventBindings>-->
    <telerik:RadTabControl.ItemTemplate>
        <DataTemplate>
            <StackPanel>
                <TextBlock Text="{Binding Title}"/>
            </StackPanel>
        </DataTemplate>
    </telerik:RadTabControl.ItemTemplate>
    <telerik:RadTabControl.ContentTemplate>
        <DataTemplate>
            <telerik:RadDocking  BorderThickness="0" Padding="0">
                <telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer>
                        <telerik:RadPaneGroup x:Name="PrimaryPaneGroup">
                            <ContentPresenter Content="{Binding}"/>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadDocking.DocumentHost>
            </telerik:RadDocking>
        </DataTemplate>
    </telerik:RadTabControl.ContentTemplate>
    <telerik:RadTabControl.ItemContainerStyle>
        <Style TargetType="telerik:RadTabItem">
            <Setter Property="MinHeight" Value="40" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="PinButtonVisibility" Value="Visible" />
            <Setter Property="CloseButtonVisibility" Value="Visible"/>
            <Setter Property="IsSelected" Value="{Binding IsActiveWorkspace}" />
        </Style>
    </telerik:RadTabControl.ItemContainerStyle>
</telerik:RadTabControl>

And here's the exception that gets thrown is as follows:

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
   at Telerik.Windows.Controls.RadPaneGroup.OnIsInDocumentHostChanged(Boolean oldValue, Boolean newValue)
   at Telerik.Windows.Controls.RadPaneGroup.Telerik.Windows.Controls.Docking.IDocumentHostAware.set_IsInDocumentHost(Boolean value)
   at Telerik.Windows.Controls.RadSplitContainer.PrepareContainerForItemOverride(DependencyObject element, Object item)
   at System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
   at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
   at System.Windows.Controls.Panel.GenerateChildren()
   at System.Windows.Controls.Panel.EnsureGenerator()
   at System.Windows.Controls.Panel.get_InternalChildren()
   at Telerik.Windows.Controls.ProportionalStackPanel.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at Telerik.Windows.Controls.RadDockPanel.MeasureOverride(Size availableSize)
   at Telerik.Windows.Controls.DockingPanel.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at Telerik.Windows.Controls.RadDockPanel.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at Telerik.Windows.Controls.RadDocking.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)

2) We have found that we can fix this issue and prevent the NullReferenceException by modifying the code above and adding a RadTabItem wrapper to the ContentTemplate like this:

<telerik:RadTabControl.ContentTemplate>
            <DataTemplate DataType="{x:Type vms:WorkspaceViewModel}">
                <telerik:RadTabItem>
                    <telerik:RadDocking  BorderThickness="0" Padding="0">
                        <telerik:RadDocking.DocumentHost>
                            <telerik:RadSplitContainer>
                                <telerik:RadPaneGroup x:Name="PrimaryPaneGroup">
                                    <ContentPresenter Content="{Binding}"/>
                                </telerik:RadPaneGroup>
                            </telerik:RadSplitContainer>
                        </telerik:RadDocking.DocumentHost>
                    </telerik:RadDocking>
                </telerik:RadTabItem>
            </DataTemplate>
        </telerik:RadTabControl.ContentTemplate>


 The problem, however, is that this makes the entire central pane basically act like a button (see attached picture ), where hovering over the pane changes the color of the entire screen.

 Neither one of these gets us any closer to what we really need: a bindable RadTabbedWindow with a dynamic/templatable/bindable RadDocking setup on each tab.
 
 I would really appreciate any pointers or help on this!
 Thank you so much for your time.

 Tim

Dinko | Tech Support Engineer
Telerik team
 answered on 14 Jan 2020
2 answers
398 views

I have problem with menu alignment on two another computers with different Windows version but with the same language, the same application.

Our menu is defined in that way:

<telerik:RadMenu Name="mainMenu"
                         VerticalAlignment="Top"
                         HorizontalAlignment="Stretch"                         
                         IsMainMenu="True"
                         FlowDirection="LeftToRight"                          
                         ClickToOpen="True"                          
                         Grid.Row="0" Grid.Column="0">
            <telerik:RadMenuItem Header="Katalog"
                                 SubmenuOpened="RadMenuItem_SubmenuOpened">
                <telerik:RadMenuItem Header="Kategorie">
                    <telerik:RadMenuItem Header="Open"></telerik:RadMenuItem>
                    <telerik:RadMenuItem Header="Refresh"></telerik:RadMenuItem>
                </telerik:RadMenuItem>
                <telerik:RadMenuItem Header="Grupy">
                    <telerik:RadMenuItem Header="Open"></telerik:RadMenuItem>
                    <telerik:RadMenuItem Header="Refresh"></telerik:RadMenuItem>
                </telerik:RadMenuItem>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Header="Motyw systemowy"
                                 SubmenuOpened="RadMenuItem_SubmenuOpened">
                <telerik:RadMenuItem Header="Crystal Light" IsCheckable="True" IsChecked="{Binding IsCrystalLight, Mode=TwoWay}"/>
                <telerik:RadMenuItem Header="Crystal Dark" IsCheckable="True" IsChecked="{Binding IsCrystalDark, Mode=TwoWay}"/>
                <telerik:RadMenuItem Header="Green Light" IsCheckable="True" IsChecked="{Binding IsGreenLight, Mode=TwoWay}"/>
                <telerik:RadMenuItem Header="Green Dark" IsCheckable="True" IsChecked="{Binding IsGreenDark, Mode=TwoWay}"/>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Header="Pomoc"
                                 SubmenuOpened="RadMenuItem_SubmenuOpened">
                <telerik:RadMenuItem Header="O programie">
                    <telerik:RadMenuItem.Icon>
                        <Image Source="{telerik:IconResource IconRelativePath=address.png, IconSources={StaticResource IconSources}}" Stretch="None"/>
                    </telerik:RadMenuItem.Icon>
                </telerik:RadMenuItem>
            </telerik:RadMenuItem>
        </telerik:RadMenu>

If I added code to properly align menu on submenu item open like below, the behaviour is also bad.

My code to align submenu:

private void RadMenuItem_SubmenuOpened(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            RadMenuItem menuItem = sender as RadMenuItem;
            if (menuItem != null)
            {
                System.Diagnostics.Debug.WriteLine($"menuItem.ActualWidth: {menuItem.ActualWidth}");
                Popup popup = menuItem.ChildrenOfType<Popup>().FirstOrDefault();
                if (popup != null)
                {
                    System.Diagnostics.Debug.WriteLine($"popup.ActualWidth: {popup.ActualWidth}");
                    System.Diagnostics.Debug.WriteLine($"((Grid)popup.Child).ActualWidth: {((Grid)popup.Child).ActualWidth}");
                    popup.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;

                    var popupWidth = ((Grid)popup.Child).ActualWidth;
                    var menuWidth = menuItem.ActualWidth;
                    
                    popup.HorizontalOffset = popupWidth - menuWidth;
                }
            }
        }

It looks like it is invalid left to right support or something else.

Please help.

 

Szczepan
Top achievements
Rank 1
 answered on 13 Jan 2020
6 answers
531 views

Hello,

I work with Telerik WPF 2016.R3 and since this morning the provider OpenStreetMap doen't work anymore

 

I check with the site of OpenStreetMap and the request done by the provider with my navigator and it works well but when my application is calling OSM to get tiles it returns an HTTP error 429 : too many requests

 

This problem only happens since this morning, last week it works perfectly.

 

All our applications use this provider to show the map, and so all our clients have the problem !

 

From my first investigations:

- the Telerik provider use HTTP protocol but when using in my navigator it redirects automatically in HTTPS (I don't know if it has an impact)

- I tried to create a new provider using Telerik Map Source of OSM to force the HTTPS but the same HTTP Error 429 happens

- Using Fiddler to check the request I succeed to have a good response when I added a User-Agent Header in the request

- using the latest demo (WPF 2019.R3), in the sample of Provider Bing and OSM, Bing works correctly but not OSM (the same HTTP error 429 happens)

 

Do you have any idea of what's happening and how to fix it please ?

 

Thank you

Thomas

 

PS : I can't update my version of Telerik because there is a very big impact on the map layer management done in v2017.R3 that cannot match our layer management in our application.

Thomas
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 09 Jan 2020
5 answers
486 views

I am importing some HTML to RadRichTextBox using HTMLFormatProvider Import.  Some of the font-family values are changing to Arial when viewing the export of HTML or XAML.

This is the import code, where editor is a RadRichTextBox:

private void ImportHtml(string HTML)
{
    HtmlFormatProvider _provider = new HtmlFormatProvider();
    HtmlImportSettings settings = new HtmlImportSettings();
  
    _provider.ImportSettings = settings;
    settings.UseDefaultStylesheetForFontProperties = true;
   editor.Document = _provider.Import(HTML);
}

 

This is the HTML being imported:

<p>
  <span style="font-family:Arial;">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span>
</p>
<p>
  <span style="font-family:Helvetica;">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span>
</p>
<p>
  <span style="font-family:TimesNewRoman;">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span>
</p>
<p>
  <span style="font-family:Verdana;">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span>
</p>

 

This is the HTML after import (exported using HTMLFormatProvider).  Notice that Verdana remains the same, but Helvetica and Times New Romans are changed to Arial in the class s_51202CB4:

"<style type=\"text/css\">\r\np { margin-top: 0px;margin-bottom: 0px;line-height: 1.15; } \r\nbody { font-family: 'Verdana'; } \r\n.Normal { telerik-style-type: paragraph;telerik-style-name: Normal;border-collapse: collapse; } \r\n.TableNormal { telerik-style-type: table;telerik-style-name: TableNormal;font-family: 'Verdana';margin-top: 0px;margin-right: 0px;margin-bottom: 0px;margin-left: 0px;text-indent: 0px;line-height: 1.15;text-align: left;border-left: 0px none #000000;border-top: 0px none #000000;border-right: 0px none #000000;border-bottom: 0px none #000000;border-collapse: collapse; } \r\n.NormalWeb { telerik-style-type: paragraph;telerik-style-name: NormalWeb;margin-top: 0px;margin-bottom: 0px;border-collapse: collapse; } \r\n.s_51202CB4 { telerik-style-type: local;font-family: 'Arial'; } \r\n.s_DF7D34AD { telerik-style-type: local;font-family: 'Verdana'; } </style><p class=\"NormalWeb \"><span class=\"s_51202CB4\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span></p><p class=\"NormalWeb \"><span class=\"s_51202CB4\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span></p><p class=\"NormalWeb \"><span class=\"s_51202CB4\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span></p><p class=\"NormalWeb \"><span class=\"s_DF7D34AD\">ABCDEFGHIJKLMNOPQRSTUVWXYZ</span></p>"

 

This is the XAML:

"<t:RadDocument xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\" xmlns:t=\"clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents\" xmlns:s=\"clr-namespace:Telerik.Windows.Documents.Model.Styles;assembly=Telerik.Windows.Documents\" xmlns:r=\"clr-namespace:Telerik.Windows.Documents.Model.Revisions;assembly=Telerik.Windows.Documents\" xmlns:n=\"clr-namespace:Telerik.Windows.Documents.Model.Notes;assembly=Telerik.Windows.Documents\" xmlns:th=\"clr-namespace:Telerik.Windows.Documents.Model.Themes;assembly=Telerik.Windows.Documents\" version=\"1.4\" LayoutMode=\"Flow\" LineSpacing=\"1.15\" LineSpacingType=\"Auto\" ParagraphDefaultSpacingAfter=\"0\" ParagraphDefaultSpacingBefore=\"0\" StyleName=\"defaultDocumentStyle\">\r\n  <t:RadDocument.Captions>\r\n    <t:CaptionDefinition IsDefault=\"True\" IsLinkedToHeading=\"False\" Label=\"Figure\" LinkedHeadingLevel=\"0\" NumberingFormat=\"Arabic\" SeparatorType=\"Hyphen\" />\r\n    <t:CaptionDefinition IsDefault=\"True\" IsLinkedToHeading=\"False\" Label=\"Table\" LinkedHeadingLevel=\"0\" NumberingFormat=\"Arabic\" SeparatorType=\"Hyphen\" />\r\n  </t:RadDocument.Captions>\r\n  <t:RadDocument.ProtectionSettings>\r\n    <t:DocumentProtectionSettings EnableDocumentProtection=\"False\" Enforce=\"False\" HashingAlgorithm=\"None\" HashingSpinCount=\"0\" ProtectionMode=\"ReadOnly\" />\r\n  </t:RadDocument.ProtectionSettings>\r\n  <t:RadDocument.Styles>\r\n    <s:StyleDefinition DisplayName=\"defaultDocumentStyle\" IsCustom=\"False\" IsDefault=\"False\" IsPrimary=\"True\" Name=\"defaultDocumentStyle\" Type=\"Default\">\r\n      <s:StyleDefinition.ParagraphStyle>\r\n        <s:ParagraphProperties LineSpacing=\"1.15\" />\r\n      </s:StyleDefinition.ParagraphStyle>\r\n      <s:StyleDefinition.SpanStyle>\r\n        <s:SpanProperties FontFamily=\"Verdana\" FontSize=\"16\" FontStyle=\"Normal\" FontWeight=\"Normal\" ForeColor=\"#FF000000\" />\r\n      </s:StyleDefinition.SpanStyle>\r\n    </s:StyleDefinition>\r\n    <s:StyleDefinition DisplayName=\"Normal\" IsCustom=\"False\" IsDefault=\"True\" IsPrimary=\"True\" Name=\"Normal\" Type=\"Paragraph\" UIPriority=\"0\" />\r\n    <s:StyleDefinition DisplayName=\"Normal (Web)\" IsCustom=\"False\" IsDefault=\"False\" IsPrimary=\"False\" Name=\"NormalWeb\" Type=\"Paragraph\" UIPriority=\"99\">\r\n      <s:StyleDefinition.ParagraphStyle>\r\n        <s:ParagraphProperties AutomaticSpacingAfter=\"True\" AutomaticSpacingBefore=\"True\" SpacingAfter=\"0\" SpacingBefore=\"0\" />\r\n      </s:StyleDefinition.ParagraphStyle>\r\n    </s:StyleDefinition>\r\n    <s:StyleDefinition DisplayName=\"Table Normal\" IsCustom=\"False\" IsDefault=\"True\" IsPrimary=\"False\" Name=\"TableNormal\" Type=\"Table\" UIPriority=\"59\" />\r\n  </t:RadDocument.Styles>\r\n  <t:Section>\r\n    <t:Paragraph StyleName=\"NormalWeb\">\r\n      <t:Span FontFamily=\"Arial\" Text=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" />\r\n    </t:Paragraph>\r\n    <t:Paragraph StyleName=\"NormalWeb\">\r\n      <t:Span FontFamily=\"Arial\" Text=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" />\r\n    </t:Paragraph>\r\n    <t:Paragraph StyleName=\"NormalWeb\">\r\n      <t:Span FontFamily=\"Arial\" Text=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" />\r\n    </t:Paragraph>\r\n    <t:Paragraph StyleName=\"NormalWeb\">\r\n      <t:Span FontFamily=\"Verdana\" Text=\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\" />\r\n    </t:Paragraph>\r\n  </t:Section>\r\n</t:RadDocument>"

 

Please let me know if I am missing something here to maintain the correct font families.

Martin
Telerik team
 answered on 09 Jan 2020
1 answer
139 views

Hi,

In my application, I am using SplineSeries in RadCartesianChart.

I am using CategoricalAxis as horizontal axis.

I want to use CategoricalAxis as vertical axis as well.

How can I achieve the same?

Dinko | Tech Support Engineer
Telerik team
 answered on 09 Jan 2020
4 answers
272 views

Are there plans to support DataFrame as DataSource in your controls?

eg. to bind the DataGrid's ItemsSource with a DataFrame

 

https://devblogs.microsoft.com/dotnet/an-introduction-to-dataframe/

Dilyan Traykov
Telerik team
 answered on 09 Jan 2020
2 answers
86 views

If I have  a small range the gauge creates duplicate labels (see attachment) note that -1, 0, 2, and 3 are on the gauge twice and  1 is there 3 times. Is there a way to not allow this to happen or make them show numbers after the decimal ex 1.5 1.75 ect...? It is using whatever the default is for tick intervals as I have not set them. 

 

Thanks!

Dinko | Tech Support Engineer
Telerik team
 answered on 09 Jan 2020
1 answer
120 views

Hi,
I am using MultipleRowsAndColumnsPanel in my application. 
I am facing some issues with it:
1. Scrolling behaviour is not working
2. When I add new tile in the view, it is not visualized. when I restart the application, all the tiles are visible as expected.
when I call base.MeasureOverride(availableSize) and base.ArrangeOverride(finalSize) methods in my overriden methods, all the newly added tiles display at position 0.

expected behaviour:
1. scrolling behaviour should work on when tiles goes out of view.
2. newly added tile should display on the view at the next position(1st position after last tile view item).

(MultipleRowsAndColumnsPanel  is copied from https://github.com/telerik/xaml-sdk/tree/master/TileView/RestoredTilesToSpanMultipleRowsAndColumns)

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Jan 2020
3 answers
264 views

Hello,

    I am trying to create view containing collection of items with with specified Row, RowSpan, Coulumn and ColumnSpan properties in RadTileView. So far I've created VM ParamsEditionViewModel containing observable collection of BindableProfileData, which wraps 

public class BindableProfileData : BindableBase
    {
        
        private ProfileItem _profileModel;
        private BindableDPDataItem _dataModel;
 
        public int Row
        {
            get { return _profileModel.DrawingSettings.Row; }
        }
 
        public int Column
        {
            get
            {
                return _profileModel.DrawingSettings.Column;
            }
        }
         
        public int RowSpan
        {
            get { return _profileModel.DrawingSettings.RowSpan; }
        }
 
         
 
        public int ColumnSpan
        {
            get { return _profileModel.DrawingSettings.ColumnSpan; }
        }
}

 

To make possible settings custom tiles size I used MultipleRowsAndColumnsPanel provided by You in one of RadGridView developers examples (link).

Whole view looks like this:

<Grid>
      <FrameworkElement.Resources>
            <DataTemplate x:Key="ItemTemplate" >
                <TextBlock Text="{Binding Name}" />
            </DataTemplate>
 
            <DataTemplate x:Key="ContentTemplate">
                <StackPanel>
                    <TextBlock Text="{Binding Row, StringFormat='Row: {0}'}"/>
                    <TextBlock Text="{Binding Column, StringFormat='Column: {0}'}"/>
                    <TextBlock Text="{Binding RowSpan, StringFormat='RowSpan: {0}'}"/>
                    <TextBlock Text="{Binding ColumnSpan, StringFormat='ColumnSpan: {0}'}"/>
                </StackPanel>
            </DataTemplate>
        </FrameworkElement.Resources>
        <Grid>
            <telerik:RadTileView x:Name="xTileView"
                             ItemTemplate="{StaticResource ItemTemplate}"
                             ContentTemplate="{StaticResource ContentTemplate}"
                             ItemsSource="{Binding SelectedCategory}"
                             IsAutoScrollingEnabled="True"
                             ColumnWidth="500"
                             RowHeight="300">
 
                <telerik:RadTileView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <controlls:MultipleRowsAndColumnsPanel RowsCount="4" ColumnsCount="3"/>
                    </ItemsPanelTemplate>
                </telerik:RadTileView.ItemsPanel>
                <telerik:RadTileView.ItemContainerStyle>
                    <Style TargetType="telerik:RadTileViewItem">
                        <Setter Property="controlls:TileViewAttachedProperties.Row" Value="{Binding Row}"/>
                        <Setter Property="controlls:TileViewAttachedProperties.Column" Value="{Binding Column}"/>
                        <Setter Property="controlls:TileViewAttachedProperties.RowSpan" Value="{Binding RowSpan}"/>
                        <Setter Property="controlls:TileViewAttachedProperties.ColumnSpan" Value="{Binding ColumnSpan}"/>
                    </Style>
                </telerik:RadTileView.ItemContainerStyle>
            </telerik:RadTileView>
        </Grid>
    </Grid>

 

The problem is that the view don't appears when I load collection to VM after button click. When I remove this block 

<telerik:RadTileView.ItemsPanel>
        <ItemsPanelTemplate>
             <controlls:MultipleRowsAndColumnsPanel RowsCount="4" ColumnsCount="3"/>
        </ItemsPanelTemplate>
</telerik:RadTileView.ItemsPanel>

The view appears but of course not if a expected format. When I paste ItemsPanel block when app is running with (Edit and Continue mode in VS), view looks just how it should be. So I have two questions. How to fix this issue and second how can I uprgrade view to load different data templates if VM observable collection contains different objects inheritating from base BindableProfileData.

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Jan 2020
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?