Telerik Forums
UI for WPF Forum
5 answers
326 views
Hello.

My scenario is pretty streight forward:
1) User docks a Pane to arbitrary position by dragging it with a mouse.
2) He then undocks it.
3) He then clicks a button which is supposed to dock the pane back where it was before undocking.

How do i impement (3) ? Is there an example somehere? How do I "store" position of single docked Pane in docking tree, and how do i "restore" it when needed?
Nasko
Telerik team
 answered on 04 Mar 2015
4 answers
223 views
Hi,

Wondering if there's a way to specify custom Measurement Unit for my Diagram, for the sake of the labels. I want the labels to show intervals in (x) units, instead of the current MeasurementUnit. Or what is a good way to customize the LabelContainer style?

Thanks!
Peshito
Telerik team
 answered on 04 Mar 2015
4 answers
765 views
I would like to enable users to copy a chart to the clipboard, preserving appearance and transparency, so I've chosen to use PNG as the format.
PngBitmapEncoder bitmapEncoder = new System.Windows.Media.Imaging.PngBitmapEncoder ();
var chartPicture = currChart.Save (96, 96, bitmapEncoder);
PngBitmapDecoder bitmapDecoder = new PngBitmapDecoder (chartPicture, BitmapCreateOptions.PreservePixelFormat, BitmapCacheOption.Default);
 
Clipboard.SetImage (bitmapDecoder.Frames[0]);

However, when I paste from the clipboard, all of the transparent areas are black, which is not desirable. I don't have much experience with clip board operations, so perhaps I am doing something wrong, though other than the transparency is seem so work fine. Is there a way I can accomplish this either and either preserve the chart's transparency or at least grabbing a rendering of the chart using its current background (almost always white)?
Tony
Top achievements
Rank 1
 answered on 03 Mar 2015
6 answers
515 views
Hey,
I've been trying to create a tooltip for a PieDataPoint, but had a couple of difficulties.
Basically, I would like to use the standard tooltip, but I could only find examples showing overriding the tooltip template for this cause. So I tried to create a similar template myself - which caused some bugs.
Mainly, I couldn't get the tooltip size to change according the content (like the strings lengths in the texblocks, I guess it'll be clearer in the xaml).
Another bug (I Believe it's another symptom of the same bug) - inside the tooltip I used a GridRows with Auto height. It seems like it calculates the row's height correctly only the second time it shows the tooltip.

This is the xaml:
<telerik:RadPieChart Palette="Windows8" Grid.Column="0" Name="PieChart">
    <telerik:PieSeries ValueBinding="Value"
                        ShowLabels="True"
                        RadiusFactor="0.6"
                        IsHitTestVisible="True"
                        ItemsSource="{Binding PieData}">
 
                        <telerik:PieSeries.LabelDefinitions>
                            <telerik:ChartSeriesLabelDefinition Margin="-10,0,0,0" Binding="Label" HorizontalAlignment="Center"/>
                        </telerik:PieSeries.LabelDefinitions>
                        <telerik:PieSeries.LegendSettings>
                            <telerik:DataPointLegendsSettings TitleBinding="Legend"/>
                        </telerik:PieSeries.LegendSettings>
                        <telerik:PieSeries.AngleRange>
                            <telerik:AngleRange StartAngle="270" SweepAngle="360"/>
                        </telerik:PieSeries.AngleRange>
                        <telerik:PieSeries.LabelConnectosSettings>
                            <telerik:ChartSeriesLabelConnectorsSettings/>
                        </telerik:PieSeries.LabelConnectosSettings>
    </telerik:PieSeries>
 
    <telerik:RadPieChart.Behaviors>
        <telerik:ChartTooltipBehavior/>
    </telerik:RadPieChart.Behaviors>
 
    <telerik:RadPieChart.SmartLabelsStrategy>
        <telerik:PieChartSmartLabelsStrategy DisplayMode="SpiderUnaligned"/>
    </telerik:RadPieChart.SmartLabelsStrategy>
 
    <telerik:RadPieChart.TooltipTemplate>
        <DataTemplate>
            <Border BorderBrush="#FFA0AFC3" BorderThickness="1">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                    <Grid.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFDFEFF" Offset="0"/>
                            <GradientStop Color="#FFDDE9F7" Offset="1"/>
                        </LinearGradientBrush>
                    </Grid.Background>
 
                    <TextBlock Text="{Binding DataItem.ToolTipTitle}" Grid.Row="0" Opacity="0.56" FontSize="13" HorizontalAlignment="Left" MaxWidth="340" FontWeight="Bold" TextWrapping="Wrap"/>
                    <TextBlock Text="{Binding DataItem.ToolTipContent}" Grid.Row="1" FontSize="12" HorizontalAlignment="Left" MaxWidth="340" TextWrapping="Wrap"/>
                </Grid>
            </Border>
        </DataTemplate>
    </telerik:RadPieChart.TooltipTemplate>
</telerik:RadPieChart>

Is there any way to use WPF default tooltip? If not, What am I doing wrong?
DDD
Top achievements
Rank 1
 answered on 03 Mar 2015
3 answers
127 views
I have a RadGridView that is working nicely, but  I have trouble with the expression Column:

1) I let the expression Column show via right mouse click. It is empty.
2) I click the Header of the Explession Column
3) RadGridView obviously tries to sort the empty Expression Column and  crashes with the CallStack posted below.

I want GridView to be stable, so whatever the user does it should not crash only because the Expression column is empty

How do I achieve this?



bei System.Linq.Expressions.Expression.Lambda(Expression body, String name, Boolean tailCall, IEnumerable`1 parameters)
bei System.Linq.Expressions.Expression.Lambda(Expression body, ParameterExpression[] parameters)
bei Telerik.Windows.Data.Expressions.SortDescriptorCollectionExpressionBuilder.Sort()
bei Telerik.Windows.Data.QueryableExtensions.Sort(IQueryable source, IEnumerable`1 sortDescriptors)
bei Telerik.Windows.Data.QueryableExtensions.Sort(IQueryable source, SortDescriptorCollection sortDescriptors)
bei Telerik.Windows.Data.QueryableCollectionView.get_FilterAndSortQueryableSourceCollection()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.CreateAggregateResults()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.CalculateAggregates()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Controls.DataControl.OnItemsCollectionChangedDispatch(Object sender, NotifyCollectionChangedEventArgs e)
bei System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.Listener`2.ReceiveWeakEvent(Object sender, TArgs args)
bei Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
bei Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
bei Telerik.Windows.Data.QueryableCollectionView.RefreshOverride()
bei Telerik.Windows.Data.QueryableCollectionView.RefreshInternal()
bei Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer()
bei Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
bei Telerik.Windows.Data.QueryableCollectionView.OnSortDescriptorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
bei System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
bei System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
bei Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target, Func`2 itemConverter)
bei Telerik.Windows.Data.CollectionHelper.Reset(IEnumerable source, IList target)
bei Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
bei Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
bei Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
bei System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
bei Telerik.Windows.Data.RadObservableCollection`1.ResumeNotifications()
bei Telerik.Windows.Controls.GridView.GridViewDataControl.PerformSorting(GridViewSortingEventArgs sortingArgs)
bei Telerik.Windows.Controls.GridView.GridViewDataControl.<>c__DisplayClass9b.<Sort>b__9a()
bei Telerik.Windows.Controls.CursorManager.PerformTimeConsumingOperation(FrameworkElement frameworkElement, Action action)
bei Telerik.Windows.Controls.GridView.GridViewDataControl.Sort(GridViewColumn column, Boolean appendToExisting)
bei Telerik.Windows.Controls.GridView.GridViewHeaderCell.RequestSort(Boolean appendToExisting)
bei Telerik.Windows.Controls.GridView.GridViewHeaderCell.PerformUserSort()
bei Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnMouseLeftButtonUp(MouseButtonEventArgs e)
bei System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
bei System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
bei System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
bei System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
bei System.Windows.Input.InputManager.ProcessStagingArea()
bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
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)
bei System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
bei System.Windows.Threading.Dispatcher.Run()
bei System.Windows.Application.RunDispatcher(Object ignore)
bei System.Windows.Application.RunInternal(Window window)
bei System.Windows.Application.Run(Window window)
bei System.Windows.Application.Run()
bei Roka3.App.Main() in C:\RZVN\Roka3\Roka3\obj\x86\Debug\App.g.cs:Zeile 0.
bei System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()
Dimitrina
Telerik team
 answered on 03 Mar 2015
4 answers
97 views
My application contains a `RadGridView` control, which has the columns defined in the XAML.  The last column is a `GridViewImageColumn` that is bound to one of several different images in the program resources, based on the value of a property in the ViewModel object.  The images represent a quality of data enumeration: Good is a Green circle, OK is a Yellow circle, Bad is a Red circle, and N/A is a Grey circle.

Everything displays fine until you click on the Filter icon and open the filtering box.  What gets displayed at that point are the pack URIs to the image resources that are being displayed, not the images.  I'd rather have the images displayed, or a string that describes what the image represents (that is, Green / Yellow / Red / N/A).

How do I modify the control so it displays the images in the Filter box instead of the image URIs?
Tony
Top achievements
Rank 1
 answered on 03 Mar 2015
1 answer
162 views
I have one project (VS 2013, .NET 4.5, Tools 2014.3.1021.45)  where a RadRichTextBox is not shown. Looking for the properties in Visual Studio there is no ActiveEditorPresenter, no Style, no Template. The RRTB is one pixel high. Same when examining the properties during runtime. I have another project where these properties are set automatically, thus the RRTB is shown as expected.
Can you give me a hint where I should start searching for the error? All references are set, there is also a reference to an implicit style for RichTextBoxUI. The two projects differ in that one has all themes in a separat sub-project, the other one not. Could this be the error?

TIA
Neils
Heiko
Top achievements
Rank 1
Iron
Veteran
 answered on 03 Mar 2015
1 answer
55 views
Hi,

I'd like my Diagram's MeasurementUnit to be 11 pixels, but the Labels always display the interval in pixel units. Is there way to specify a custom MeasurementUnit? Or how would I go changing the LabelContainer style to do this?

Thanks!
Peshito
Telerik team
 answered on 03 Mar 2015
2 answers
213 views
Hi Everyone!

I wanna Draw LJ Chart with radChart controls, but one problem is:

How to customize axisY label like the attachment showing .

And thanks for anyway!
Martin Ivanov
Telerik team
 answered on 03 Mar 2015
3 answers
126 views
There is problem with the DataContext of children inside the GridView:
For some reason, the DataContext of the GridViewHeaderRow gets overwritten by a local value (of type System.Object). Therefore, the property is not inherited and it is not possible to bind to members of the GridView DataContext any more!

The value is overwritten in DataCellsPresenter.cs (the corresponding line marked bold), although I don't see any reason to do this:

public override void OnApplyTemplate()
{
    base.OnApplyTemplate();
 
    this.ItemsHost = this.GetTemplateChild("PART_ItemsHost") as Panel;
    GridViewRow gridViewRow = this.RadRowItem as GridViewRow;
 
    if (this.RadRowItem != null &&
        this.RadRowItem.GridViewDataControl == null)
    {
        this.RadRowItem.GridViewDataControl =
            this.RadRowItem.ParentOfType<GridViewDataControl>();
    }
 
    if (gridViewRow != null)
    {
        this.Item = gridViewRow.Item;
        gridViewRow.EnsureDataCellsPresenterSize();
    }
    else if (this.RadRowItem is GridViewHeaderRow)
    {
        this.Item = new object();
    }
    else if (this.RadRowItem is GridViewFooterRow)
    {
        this.Item = this.RadRowItem.GridViewDataControl.AggregateResults;
 
        this.TrackAggregatesChanges(this.RadRowItem.GridViewDataControl.AggregateResults);
    }
    else if (this.RadRowItem is GridViewGroupFooterRow)
    {
        this.Item = this.RadRowItem.Item;
    }
 
    // At the time that a Row is prepared we can't Sync because the CellsPresenter isn't created yet.
    // Doing it here ensures that the CellsPresenter is in the visual tree.
    this.SyncProperties();
 
    this.SetFrozenColumnSplitterPosition();
}
Ivan Ivanov
Telerik team
 answered on 03 Mar 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?