Telerik Forums
UI for WPF Forum
2 answers
229 views

To illustrate MultiSelectComboBox, I am using some forum posted code.

for comboBox i am using

 

<telerik:RadComboBox SelectedIndex="0" x:Name="MembersComboBox"                                    
   ItemsSource="{Binding Members}"
   ItemTemplate="{StaticResource MultiSelectionComboBoxItemTemplate}"
   Visibility="{Binding CanViewOtherUserTrendingConfiguration}"
   SelectionBoxTemplate="{StaticResource MultiSelectionComboBoxSelectionBoxTemplate}"
   ToolTip="{Binding SelectedMembersText}"
   Width="150" Height="20" />
 as i am using MVVM pattern, above comboBox is contained in a user Control RadDocumentPane, and MainChartView userControl DataContext contains the ViewModel

<telerik:RadDocumentPane x:Class="MainChart.MainChartView"
...
>

 and datatemplate MultiSelectionComboBoxSelectionBoxTemplate is defined as

<DataTemplate x:Key="MultiSelectionComboBoxSelectionBoxTemplate">
 <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type telerik:RadDocumentPane}, Mode=FindAncestor}, Path=DataContext.SelectedMembersText}" />
</DataTemplate>

 my question is when i check the checkboxes in the comboBox, it updates the tooltip of combo box, which is bind to viewModel's property SelectedMembersText, but it do not updates the textlbock inside the SelectionBoxTemplate. I am sure i am making some mistake in doing dataBinding. please help me fixing this issue, as i have already applied all possible ways(in my knowledge) of binding textBlock to the field.

 

 

 

 

 

 

 

 

 

1.<telerik:RadComboBox SelectedIndex="0" x:Name="MembersComboBox"                                    
2.                                     ItemsSource="{Binding Members}"
3.                                     ItemTemplate="{StaticResource MultiSelectionComboBoxItemTemplate}"
4.                                  
5.                                     Visibility="{Binding CanViewOtherUserTrendingConfiguration}"
6.                                     SelectionBoxTemplate="{StaticResource MultiSelectionComboBoxSelectionBoxTemplate}"
7.                                     ToolTip="{Binding SelectedMembersText}"
8.                                     Width="150" Height="20" />
1.<telerik:RadComboBox SelectedIndex="0" x:Name="MembersComboBox"                                    
2.                                     ItemsSource="{Binding Members}"
3.                                     ItemTemplate="{StaticResource MultiSelectionComboBoxItemTemplate}"
4.                                  
5.                                     Visibility="{Binding CanViewOtherUserTrendingConfiguration}"
6.                                     SelectionBoxTemplate="{StaticResource MultiSelectionComboBoxSelectionBoxTemplate}"
7.                                     ToolTip="{Binding SelectedMembersText}"
8.                                     Width="150" Height="20" />
Kalin
Telerik team
 answered on 04 Aug 2015
1 answer
154 views

Hello,

I am trying to remove a RadDocumentPane from a region when its closed, but I cant find a way to catch the close event in my viewmodel?

Whats the best approach to accomplished this with the Docking control?

 

Marcel

 

Vladi
Telerik team
 answered on 04 Aug 2015
2 answers
79 views

It's Telerik UI for WPF 2014.3.1202.40.

There is a  RadCartesianChart on screen. Once user clicks on outside region of the chart, the track ball disappears due to losing keyboard focus.

Is it possible to keep the track ball inside chart in this case? It still has logical focus anyway.

Thanks.

Lian
Top achievements
Rank 2
 answered on 03 Aug 2015
1 answer
172 views

Say I have a Diagram that is 1920x1080.  I call ExportToImage with an enclosingBounds of (0, 0, 1920, 1080), a returnImageSize of (1920,1080), and a dpi of 384.

 I get an image that is 7680 x 4320.  Is that expected?  I am (perhaps naively) expecting to get an image that is 1920x1080, based on the value of the returnImageSize parameter.

 Thanks!

-David

 

Kiril Vandov
Telerik team
 answered on 03 Aug 2015
2 answers
86 views

We are using the TextControl (http://www.textcontrol.com) in an WinForms application used by more then 40.000 employees.
Now we are migrating the application to WPF.
We realize a problem on HD Displays, where standard build-in dialogs like Search and Replace, Spellchecker, Font Format dialogs etc. are too small - maybe because standard MVC dialogs are still used.

 

What about the Telerik RichTextBox control?
Are all Build-In dialogs scaling on HD-Displays correctly?

 

 

Svetoslav
Telerik team
 answered on 03 Aug 2015
1 answer
339 views

Hi,

 I tried to implement the MouseLeftButtonDown event and the CellDoubleClick event on a style:

<Style TargetType="{x:Type telerik:GridViewHeaderCell}">
            <Setter Property="Foreground" Value="White"/>
            <EventSetter Event="CellDoubleClick" Handler="SelectDeselectColumn"/>
            <EventSetter Event="MouseLeftButtonDown " Handler="SelectDeselectColumn2"/>
</Style>

 

The "CellDoubleClick" event works fine but the "MouseLeftButtonDown" event doesn't work! I tried each event alone in the style and the MouseLeftButtonDown never works!

In the class "GridViewHeaderCell" there is no event accessible for MouseLeftButtonDown, there is only a method called "OnMouseLeftButtonDown" My guess is that the event MouseLeftButtonDown (or MouseDown) is already handled somewhere else...

If I want to use the method "OnMouseLeftButtonDown" I have to create a new ​child class that the parent is "GridViewHeaderCell". But I don't know where to allocate the new class in the code. Is there a event like "AutogeneratingCoumn"?

Is there any other options possible to support the MouseLeftButtonDown event or a single click?

 

 

 ​

 

 

 

Dimitrina
Telerik team
 answered on 03 Aug 2015
3 answers
131 views

I'm looking for a way for an autogenerated propertygrid checkbox item to disable (IsReadOnly/ReadOnlyEditorState) other items in the grid.

Is there an event or a isSelected for the generated checkbox available somehow?

 

Thank you,

Garrick

 

Maya
Telerik team
 answered on 03 Aug 2015
2 answers
236 views

I have a bread-crumb, i make a control-template for this bread-crumb

(i do it automatic in the blend- "EditTemplate"->"Edit a copy")

the problem:

when i used this template my history pop-up is always empty, (the history in the model - correct, but on the view its empty!).

thenk you for helping!

 

the template code:

<ControlTemplate x:Key="RadBreadcrumbControlTemplate1" TargetType="{x:Type telerik:RadBreadcrumb}">
<Grid x:Name="outerGrid">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.ColumnSpan="3"/>
<Image x:Name="image" Margin="5,0" Source="{Binding CurrentContainer.Image, RelativeSource={RelativeSource TemplatedParent}}">
<Image.Style>
<Style TargetType="{x:Type Image}">
<Setter Property="MaxHeight" Value="16"/>
<Setter Property="MaxWidth" Value="16"/>
</Style>
</Image.Style>
<Image.Visibility>
<Binding Path="IsCurrentIconVisible" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:BooleanToVisibilityConverter/>
</Binding.Converter>
</Binding>
</Image.Visibility>
</Image>
<Breadcrumb:RadBreadcrumbBar x:Name="BreadcrumbBar" Grid.Column="1" Foreground="{TemplateBinding Foreground}" ItemTemplate="{TemplateBinding ItemTemplate}"/>
<telerik:RadSplitButton x:Name="historySplitButton" Grid.ColumnSpan="2" Grid.Column="1" InnerCornerRadius="0">
<telerik:RadSplitButton.DropDownContent>
<ListBox x:Name="HistoryListBox" BorderThickness="0" HorizontalContentAlignment="Stretch" Padding="2">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</telerik:RadSplitButton.DropDownContent>
<telerik:RadSplitButton.Style>
<Style TargetType="{x:Type telerik:RadSplitButton}">
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="IsOpen" Value="False"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadSplitButton}">
<Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<telerik:RadToggleButton x:Name="DropDownPart" Grid.Column="1" IsTabStop="False" IsChecked="{Binding IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" InnerCornerRadius="0" Margin="0,-1,0,0" MinWidth="11" MinHeight="7" Grid.Row="2" Style="{TemplateBinding TogglePartStyle}" Visibility="{TemplateBinding DropDownIndicatorVisibility}"/>
<telerik:RadButton x:Name="ButtonPart" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="1" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" InnerCornerRadius="0" Padding="{TemplateBinding Padding}" Grid.Row="1" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
<telerik:RadButton.Style>
<Style TargetType="{x:Type telerik:RadButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type telerik:RadButton}">
<ContentPresenter x:Name="Content" Grid.ColumnSpan="2" Content="{TemplateBinding Content}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadButton.Style>
<telerik:RadButton.Visibility>
<Binding Mode="TwoWay" Path="IsButtonPartVisible" RelativeSource="{RelativeSource TemplatedParent}">
<Binding.Converter>
<telerik:BooleanToVisibilityConverter/>
</Binding.Converter>
</Binding>
</telerik:RadButton.Visibility>
</telerik:RadButton>
</Grid>
<Popup x:Name="DropDownPopup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" StaysOpen="False">
<Grid>
<Border x:Name="DropDownPopupBorder" BorderBrush="#FF848484" BorderThickness="1" Background="White" CornerRadius="0" Height="{TemplateBinding DropDownHeight}" MaxWidth="{TemplateBinding DropDownMaxWidth}" MaxHeight="{TemplateBinding DropDownMaxHeight}" Margin="0" MinWidth="3" MinHeight="3" Width="{TemplateBinding DropDownWidth}">
<ContentPresenter x:Name="DropDownPopupContent" ContentTemplate="{TemplateBinding DropDownContentTemplate}" Content="{TemplateBinding DropDownContent}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Border>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="False"/>
<Trigger Property="IsOpen" Value="True">
<Setter Property="Panel.ZIndex" TargetName="DropDownPart" Value="1"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True"/>
<Trigger Property="DropDownButtonPosition" Value="Right">
<Setter Property="Grid.Column" TargetName="DropDownPart" Value="2"/>
<Setter Property="Grid.Row" TargetName="DropDownPart" Value="1"/>
<Setter Property="Margin" TargetName="DropDownPart" Value="-1,0,0,0"/>
</Trigger>
<Trigger Property="IsButtonPartVisible" Value="False">
<Setter Property="Grid.Column" TargetName="DropDownPart" Value="0"/>
<Setter Property="Grid.ColumnSpan" TargetName="DropDownPart" Value="3"/>
<Setter Property="IsTabStop" TargetName="DropDownPart" Value="True"/>
</Trigger>
<Trigger Property="IsFocused" Value="True"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</telerik:RadSplitButton.Style>
<TextBox x:Name="pathTextBox" BorderThickness="0" Margin="1" MinHeight="20">
<telerik:StyleManager.Theme>
<telerik:Office_BlackTheme/>
</telerik:StyleManager.Theme>
</TextBox>
</telerik:RadSplitButton>
<Popup x:Name="AutocompletePopup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsAutocompleteOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" StaysOpen="False">
<ListBox x:Name="AutoCompleteListBox" BorderBrush="#FF848484" BorderThickness="1" MaxWidth="650" MaxHeight="500" MinWidth="100" MinHeight="30">
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Padding" Value="0"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Top"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</Popup>
<telerik:RadToggleButton x:Name="historyToggle" BorderBrush="Transparent" Background="Transparent" Grid.Column="3" Command="Breadcrumb:RadBreadcrumbCommands.HistoryDropDown" InnerCornerRadius="0" Width="15">
<Path x:Name="DropDownIndicator" Data="M0,0L5,0 5,1 4,1 4,2 3,2 3,3 2,3 2,2 1,2 1,1 0,1 0,0z" Fill="Black" HorizontalAlignment="Center" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
</telerik:RadToggleButton>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsTextMode" Value="True">
<Setter Property="Visibility" TargetName="historySplitButton" Value="Visible"/>
<Setter Property="Visibility" TargetName="BreadcrumbBar" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="historyToggle" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsTextMode" Value="False">
<Setter Property="Visibility" TargetName="historySplitButton" Value="Collapsed"/>
<Setter Property="Visibility" TargetName="BreadcrumbBar" Value="Visible"/>
<Setter Property="Visibility" TargetName="historyToggle" Value="Visible"/>
<Setter Property="IsChecked" TargetName="historyToggle" Value="False"/>
</Trigger>
<Trigger Property="IsAutocompleteOpen" Value="True">
<Setter Property="Panel.ZIndex" TargetName="historySplitButton" Value="1"/>
</Trigger>
<Trigger Property="IsTextModeEnabled" Value="False">
<Setter Property="Visibility" TargetName="historyToggle" Value="Collapsed"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

miri
Top achievements
Rank 1
 answered on 03 Aug 2015
6 answers
133 views
Hi,
The attached exception appears when i'm changing the view between timeline and month is some circumstances
I'm using product version 2010.3.1314.40

===================================


'TimeRulerMonthViewGroupItem' TargetType does not match type of element 'TimeRulerGroupItem'. (PresentationFramework)


------------------------------
Program Location:


   at System.Windows.Style.CheckTargetType(Object element)
   at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
   at System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.ScheduleView.Extensions.SetStyleWithType(FrameworkElement element, Style style)
   at Telerik.Windows.Controls.ScheduleViewBase.ApplyTickItemStyle(FrameworkElement container, Object item)
   at Telerik.Windows.Controls.TimeRulerPanel.PrepareItem(TimeRulerItemBase item)
   at Telerik.Windows.Controls.RecycleHelper`1.PrepareItem(Int32 index)
   at Telerik.Windows.Controls.RecycleHelper`1.PrepareItems(IValuesContainer indexTree, DateTime startDate, DateTime endDate)
   at Telerik.Windows.Controls.TimeRulerPanel.PrepareItems()
   at Telerik.Windows.Controls.TimeRulerPanel.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.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 Telerik.Windows.Controls.TransitionControl.TransitionPresenter.MeasureOverride(Size availableSize)
   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 System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   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.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 System.Windows.Controls.Grid.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 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.Control.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.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.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 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.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.Documents.AdornerDecorator.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.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   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 Divelements.SandDock.SplitContainer.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.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 System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at Divelements.SandDock.Primitives.WindowHierarchyPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at Divelements.SandDock.DockSite.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.DockPanel.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 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.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   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.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
   at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV)
   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.Border.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Documents.AdornerDecorator.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Window.MeasureOverrideHelper(Size constraint)
   at System.Windows.Window.MeasureOverride(Size availableSize)
   at ActiproSoftware.Windows.Controls.Ribbon.RibbonWindow.MeasureOverride(Size availableSize)
   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.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)


Nasko
Telerik team
 answered on 03 Aug 2015
2 answers
295 views

Following your Serialize a Databound Diagram article
I was wondering whether the RadDiagram Serialization/Deserialization system supports serialization of a collection within the GraphSource Nodes. In particular I am interested on using an ObservableCollection:

01.public class OrgItem : HierarchicalNodeViewModel
02.{
03.    public OrgItem()
04.    {
05.       this.MyCollection = new ObservableCollection<string>();
06.    }
07.    public ObservableCollection<string> MyCollection
08.    {
09.        get;
10.    }
11.
12.
13.
14.}
15.private void BindGraphSource()
16.{
17.    int uniqueIdCounter = 0;
18.    GraphSource source = new GraphSource();
19.    OrgItem rootItem = new OrgItem()
20.    {
21.        Title = "CEO",
22.        Position = new Point(200, 20),
23.        Id = (uniqueIdCounter++).ToString()
24.    };
25.    rootItem.MyCollection.Add(new MyClass(“Test1”));
26.    rootItem.MyCollection.Add(new MyClass(“Test2”));
27.    source.AddNode(rootItem);
28.
29.
30.
31.}
32.public class MyClass
33.{
34.    public MyClass(){};
35.    public MyClass(string myValue)
36.    {
37.        this.MyValue = myValue;
38.    }
39.    public string MyValue { get; set; }
40.}

 

Could I possibly Serialize/Deserialize the ObservableCollection in the OrgItem?

If that is possible how should i serialize/deserialize the collection in the GraphSource?

01.public class GraphSource : SerializableGraphSourceBase<OrgItem, OrgLink>
02.{
03.    public override string GetNodeUniqueId(OrgItem node)
04.    {
05.        return node.Id;
06.    }
07.    public override void SerializeNode(OrgItem node,
08.        Telerik.Windows.Diagrams.Core.SerializationInfo info)
09.    {
10.        base.SerializeNode(node, info);
11.        info["Title"] = node.Title;
12.    }
13.    public override OrgItem DeserializeNode(
14.        Telerik.Windows.Diagrams.Core.IShape shape,
15.        Telerik.Windows.Diagrams.Core.SerializationInfo info)
16.    {
17.        base.DeserializeNode(shape, info);
18.        if (info["Title"] != null)
19.        {
20.            return new OrgItem(info["Title"].ToString());
21.        }
22.        return null;
23.    }
24.}

 

Many thanks in advance,

Christos

Christos
Top achievements
Rank 1
 answered on 01 Aug 2015
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
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?