Telerik Forums
UI for WPF Forum
1 answer
89 views
Hi,

the Execute Save Method works fine. Now I save the diagram like this: owner.fileManager.SaveToFile();

But, is it possible to save the Diagram fix to a declared path? The best would be, that the user just click
on save and a box apperas after saving the diagram. I don't want to give the user the permission to save
the diagram with an ohter name or on an other direcotry!

Is this possible?

Thanks
Rene
ITA
Top achievements
Rank 1
 answered on 28 May 2014
4 answers
122 views
Hi,

I have a Problem with the "CanExecutedSave" Event. If a drop a Shape on my diagram this Event will not fired. I have
to do something else before, for example Close an open the Toolbox with my shapes. Now the to "CanExecuteEvent"
will be fired and after it, I the "ExecuteSave" works fine.

Any Ideas?

Thanks
Best Regards
Rene
ITA
Top achievements
Rank 1
 answered on 28 May 2014
9 answers
208 views
Here is my code:
var diagramToExportView = new DiagramToExportView();
//diagramToExportView.diagram is a RadDiagram, diagramToExportView is a WPF UserControl
diagramToExportView.diagram.Measure(new Size(640, 450));
diagramToExportView.diagram.Arrange(new Rect(new Size(640, 450)));
 
diagramToExportView.diagram.ExportToImage(stream, null, null, margin: _exportMargin,
                    backgroundBrush: new SolidColorBrush(Colors.White));

this seems working as expected: the stream contains a diagram image and nothing is shown / added to the visual tree.
The problem is that the diagram is not "completely" drawn, see the attached screenshots (expected vs actual): the additional connection geometries comes from this code (basically a custom connection):

public class MyConnection : RadDiagramConnection {
 
   protected override void UpdateGeometryOverride() {
            base.UpdateGeometryOverride();
 
            // draw geometry
     }
}

My guess is that Measure / Arrange calls don't triggers everything on the diagram's layout.
Any idea?
Peshito
Telerik team
 answered on 28 May 2014
1 answer
77 views
Greetings.  
 
   I have searched the forums and not found anything similar to the issue we are experience. 

We have a RadGridView with the ItemSource set to an observable collection of dynamic objects.

The grid works fine for autogenerating the columns for each of the "properties" on the dynamic object.

When we attach a CellEditTemplateSelector to the colums in the AutoGeneratingColumn event, the editing stops working.

What I mean is that when the TrySetMember method is called as part of the CommitEdit, the SetMemberBinder passed in is correct, but the value passed is null.  If we don't use the Edit Template Selector it works fine.

We need the template selector because there are over 200 possible properties on the dynamic object and the user has the ability to add additional ones.  These properties range from simple string fields to values that are selected from a specific list.  The edit templates apply the appropriate control based on the attributes of the property object.

Any help or direction you can provide would be greatly appreciated.

- James


Ivan Ivanov
Telerik team
 answered on 28 May 2014
2 answers
238 views
Hi,

i'm looking for a code-snipe which shows me how so create an appointment by c#. It is no problem to create a simple appointment for one day. But if i try to crearte an appointment in serie it doesn't work. The Problem could be the DateTime Property Start and End.

It get this Error:
ArgumentOutOfRangeException.

The added or subtracted value results in an unrepresentable DateTime.
Parameter name: value


NOTE:
Beginn with the Example "ScheduleView and TimeBar". This works fine so far. But if you create an Appointment with a frequency ex.:
Pattern.Frequency = RecurrenceFrequency.Monthly; you will get the error above. 
This part from xaml causes the error: CurrentDate="{Binding ElementName=TimeBar, Path=SelectionStart}"

<telerik:RadScheduleView x:Name="MainSchedule" Grid.Row="1" Margin="2" TimeMarkersSource="{Binding TimeMarkers}"
CategoriesSource="{Binding Categories}" telerik:StyleManager.Theme="Metro" MinAppointmentHeight="10"
NavigationHeaderVisibility="Collapsed" AppointmentsSource="{Binding Appointments}"ResourceTypesSource="{Binding ResourceTypes}" CurrentDate="{Binding ElementName=TimeBar, Path=SelectionStart}">

Error:
System.Reflection.TargetInvocationException
Ein Aufrufziel hat einen Ausnahmefehler verursacht.
   bei System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   bei System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   bei System.Delegate.DynamicInvokeImpl(Object[] args)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

 
System.ArgumentOutOfRangeException
Der addierte oder subtrahierte Wert ergibt eine nicht darstellbare DateTime.
Parametername: value
   bei System.DateTime.Subtract(TimeSpan value)
   bei Telerik.Windows.Controls.ScheduleView.AppointmentExtensions.GetOccurrences(IAppointment appointment, DateTime from, DateTime to) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Extensions\AppointmentExtensions.cs:Zeile 26.
   bei Telerik.Windows.Controls.AppointmentsHelper.GetRecurrenceOccurrences(IAppointment appointment, IDateSpan effectiveRange, IEnumerable`1 parentKeys, IEnumerable`1 groupedResources) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Helpers\AppointmentsHelper.cs:Zeile 47.
   bei Telerik.Windows.Controls.ScheduleViewBase.GetOccurrences(IAppointment appointment, IDateSpan effectiveSpan, IEnumerable`1 parentKeys) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 4007.
   bei Telerik.Windows.Controls.ScheduleViewBase.<>c__DisplayClass85.<GetAppointmentSlotGroupInfos>b__7f(IAppointment a) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 1624.
   bei System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   bei System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   bei System.Linq.Enumerable.<SelectManyIterator>d__1d`2.MoveNext()
   bei System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   bei System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   bei Telerik.Windows.Controls.ScheduleViewBase.GetAppointmentSlotGroupInfos(GroupItemInfo groupItemInfo, Boolean isAllDayArea) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 1623.
   bei Telerik.Windows.Controls.ScheduleViewBase.InitializeColumnsAndUpdateMaxIntersectedAppointmentsCount() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 4028.
   bei Telerik.Windows.Controls.ScheduleViewBase.Initialize() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 3953.
   bei Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.OnNotifyingDataSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleViewDataConnection.cs:Zeile 776.
   bei Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleViewDataConnection.cs:Zeile 595.
   bei System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
   bei System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   bei System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   bei System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   bei System.Windows.Data.ListCollectionView.RefreshOverride()
   bei System.Windows.Data.CollectionView.Refresh()
   bei System.Windows.Data.CollectionView.EndDefer()
   bei System.Windows.Data.CollectionView.DeferHelper.Dispose()
   bei Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.SetGroupingAndFiltering(IEnumerable`1 groupDescriptions) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleViewDataConnection.cs:Zeile 658.
   bei Telerik.Windows.Controls.ScheduleViewBase.RegenerateGroupHeaders() in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 3802.
   bei Telerik.Windows.Controls.ScheduleViewBase.UpdatePropertiesDependantOnViewDefinition(String propertyName) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 3109.
   bei Telerik.Windows.Controls.ScheduleViewBase.OnCurrentDatePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) in c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:Zeile 2298.
   bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   bei System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)
   bei System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   bei System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   bei System.Windows.Data.BindingExpression.Activate(Object item)
   bei System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
   bei System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
   bei MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
   bei MS.Internal.Data.DataBindEngine.Run(Object arg)
   bei MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
   bei System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
   bei System.Windows.ContextLayoutManager.UpdateLayout()
   bei System.Windows.UIElement.UpdateLayout()
   bei System.Windows.Interop.HwndSource.SetLayoutSize()
   bei System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   bei System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   bei MS.Internal.DeferredHwndSource.ProcessQueue(Object sender, EventArgs e)

Dear Telerik Team how can i solve this Problem ???????


Thanks a log
Best Regards
R
Kalin
Telerik team
 answered on 28 May 2014
2 answers
292 views
Is there a way to customize the horizontal and vertical ruler to display units in inches or mm ?
Rajkumar
Top achievements
Rank 1
 answered on 28 May 2014
5 answers
128 views

I have a small test project to check the Drag/Drop feature of RadTreeListView. Markup:

<t:RadTreeListView ItemsSource="{Binding Items}" IsReadOnly="True" IsDragDropEnabled="True" x:Name="tree" AutoGenerateColumns="False">
<t:RadTreeListView.DragCueItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Name}"/>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Children count : "/>
<TextBlock Text="{Binding Children.Count}"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</t:RadTreeListView.DragCueItemTemplate>
<t:RadTreeListView.ChildTableDefinitions>
<t:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
</t:RadTreeListView.ChildTableDefinitions>
<t:RadTreeListView.Columns>
<t:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Nume"/>
</t:RadTreeListView.Columns>
</t:RadTreeListView>

 

 

 

 


Nothing fancy here... I bind it to a simple hierarchy of Node's and if I drag an item I receive this event in 

 

 

 

private static void TreePreviewDragEnded(object sender, RadTreeListViewDragEndedEventArgs e)
{
Debug.WriteLine("DropPosition: " + e.DropPosition);
Debug.WriteLine("IsCanceled: " + e.IsCanceled);
Debug.WriteLine("TargetDropItem: " + (e.TargetDropItem == null ? "<null>" : e.TargetDropItem.ToString()));
Debug.WriteLine("DraggedItems: " + e.DraggedItems);
if (e.DraggedItems.Count > 0)
{
foreach (var item in e.DraggedItems)
{
Debug.WriteLine(" Dragged item : " + item);
}
}
Debug.WriteLine("-----------------");
}



The issue is that no matter if I drop between (see attachment 1) or drop inside (see attachment 2) in the PreviewDragEnded event handler I always get e.DropPosition == Inside.

Am I doing something wrong?

Nick
Telerik team
 answered on 28 May 2014
1 answer
88 views
HI,

i create some custom Shapes on my diagram, with a cutom ContentTabTemplate, Now I want to open a RadWindo for some
Input and give the Data back to the Shape? Is this possible?

Thanks
Manfred
Martin Ivanov
Telerik team
 answered on 28 May 2014
2 answers
200 views
Our WPF application contains multiple RadRichTextBox instances. When right clicking in one of the instances I expected the ContextMenu_Showing event to get fired for only the RadRichTextBox control that I right clicked. This is not the case. 

The method gets fired for each instance of the RadRichTextBox.  As a result, instead of getting one "View Source" context menu item inserted into the context menu, I get one for each RadRichTextBox control.

I am trying to implement the modification of the RadRichTextBox's context menu as indicated at the following link:
http://www.telerik.com/help/wpf/radrichtextbox-features-context-menu.html

I also modified the example as indicated in the following blog to reference the correct ContextMenu:
http://blogs.telerik.com/xamlteam/posts/10-11-17/customizing-radrichtextbox-s-contextmenu-and-selectionminitoolbar.aspx

In the Telerik public constructor I have the following code:

            Telerik.Windows.Controls.RichTextBoxUI.ContextMenu contextMenu =
                (Telerik.Windows.Controls.RichTextBoxUI.ContextMenu)this.radRichTextBox.ContextMenu;
            contextMenu.Showing += this.ContextMenu_Showing;

I also have the following methods:

        private void ContextMenu_Showing(object sender, Telerik.Windows.Controls.RichTextBoxUI.Menus.ContextMenuEventArgs e)
        {
            RadMenuItem makeViewSourceMenuItem = new RadMenuItem()
            {
                Header = "View Source"
            };
            makeViewSourceMenuItem.Click += MakeViewSourceMenuItem_Click;
            ContextMenuGroup customContextMenuGroup = new ContextMenuGroup();
            customContextMenuGroup.Add(makeViewSourceMenuItem);
            e.ContextMenuGroupCollection.Add(customContextMenuGroup);
        }        private void MakeViewSourceMenuItem_Click(object sender, RadRoutedEventArgs e)
        {
            FrmHtmlSource dialog = new FrmHtmlSource(_originalText);
            dialog.ShowDialog();
        }

All the examples I have seen involve just one instance of the RadRichTextBox.  Is there anything special I need to do to support multiple instances or is this a limitation with the RadRichTextBox control.
Ralph
Top achievements
Rank 1
 answered on 27 May 2014
1 answer
96 views
This code takes the DataContext of the Diagram and Serializes it to XML and saves it to file.  However, I want to keep the shape's properties in my own object as XML.  So, I don't want it to save to file.  I want to the read the value into my own object then Serialize my object using XmlSerialization.  Is there any other option to get diagram to give up its XML?   Can this be done using your Persistance framework?

As always, a code example is appreciated.


FileManager fileManager = new FileManager(diagram);
fileManager.SaveToFile(FileLocation.Disk);
Joel Palmer
Top achievements
Rank 2
 answered on 27 May 2014
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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?