Telerik Forums
UI for WPF Forum
6 answers
317 views
I'm trying to implement a property editor control for an application using the RadPropertyGrid. The user will select from a list of objects and the propertygrid editor needs to change based on the object type. That would be perfectly fine if we were giving access to ALL properties of each object, but we only want to display specific subset of each object to the end user, and that subset will vary based on each object type. For example, an object of type Circle we may want to display the center point coordinates and a radius, while a Rectangle we want to display lower-left coordinates and a width and height. These object classes are defined in a 3rd party library, and each of them have many other properties we don't want to expose.

Ideally it would be great if we could set AutoGeneratePropertyDefinitions to false and define a different set of RadPropertyGrid.PropertyDefinitions for each type, then switch that set of definitions based on the object type. I've used converters to change controls' style properties based on object types before, but since since the PropertyDefinitions isn't a property itself, I can't use that same technique.

Any suggestions?

Thanks!
Mahdi
Top achievements
Rank 1
 answered on 28 May 2014
1 answer
134 views
Hi, 
   how to find the single span between HyperlinkRangeStart and HyperlinkRangeEnd?


Thanks!

Petya
Telerik team
 answered on 28 May 2014
1 answer
93 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
127 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
212 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
81 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
240 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
297 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
136 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
91 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
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
DataPager
PersistenceFramework
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?