Telerik Forums
UI for WPF Forum
1 answer
125 views

Hello great team,

I have the following issue.

I have a RadContextMenu with 5 menu items. Some of those items have children items too.

1 When I click on an item which doesn't have children - it performs the action and menu is closed which is great.

2 When I click on an item which have children - it just close the menu. I want when I click on a menu which have children just to expand and show those children.

So when I click on children menu to close again?

How can I achieve the second point above?

 

Thanks in Advance

Martin Ivanov
Telerik team
 answered on 18 Jun 2019
1 answer
147 views
Hi, i am creating an annotation dynamically using custom behavior (user set annotation points by clicking on scatter plot). The problem is to bound the annotation to categorical axis. I need to have annotation in any place user wants, not only in one of the CategoricalAxis values (for example in the middle of two categories). Can you help me with some ideas how can i do that?
Martin Ivanov
Telerik team
 answered on 18 Jun 2019
2 answers
771 views

My problem is simple: In my RadExpander header template, I am unable to access the properties of the data context of the expander itself.  Why does the header not have the same data context?

Here is a simple example:  A main Window with a label and a RadExpander (with HeaderTemplate).  The simple label easily accesses the "Name" property.  The RadExpander's HeaderTemplate cannot

 

<Window x:Class="TestTelerik.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:tk="http://schemas.telerik.com/2008/xaml/presentation"
                xmlns:testTelerik="clr-namespace:TestTelerik"
                Title="MainWindow" Height="350" Width="525"
                >
    <StackPanel>
 
        <!-- This shows up just fine -->
 
       <Label Content="{Binding HeaderTitle}"/>
 
        <tk:RadExpander>
            <tk:RadExpander.HeaderTemplate>
                <DataTemplate>
                     <!-- This does not show.  Why not? -->
                    <Label Content="{Binding HeaderTitle}"/>
                </DataTemplate>
            </tk:RadExpander.HeaderTemplate>
        </tk:RadExpander>
    </StackPanel>
</Window>

 

The DataContext of this window is just itself:

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        DataContext = this;
    }
 
    public string HeaderTitle => "Items!";
}

My real-world use case it actually quite a bit more complicated so it's not a viable solution for me to try to bind the "RadExpander.Header" property directly. 

Nor can I use the  "ElementName=" binding syntax.  Not in my case

What is the best way to make the RadExpander HeaderTemplate inherit its the RadExpander's  data context?

 

Martin Ivanov
Telerik team
 answered on 18 Jun 2019
1 answer
109 views

I just added a datapager to my project but it does not seem to be honoring the Windows8touch theme.

I have the window8touch dll referenced properly as everything else works.

==> Telerik.Windows.Themes.Windows8Touch

What do I have wrong.

<ResourceDictionary.MergedDictionaries>
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/System.Windows.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.Chart.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.Input.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.Data.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.DataVisualization.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Documents.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Documents.Proofing.xaml" />
    <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8Touch;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
</ResourceDictionary.MergedDictionaries>

 

David Ocasio
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 17 Jun 2019
2 answers
115 views

Hi all,

I am updating some code and it appears the use of InsertReadOnlyPage(DocumentPosition start, DocumentPosition end) from RadDocument is obselete and replaced by RadDocumentEditor.InsertReadOnlyPage().

 

The original call was the following (note the parameters):

1.editor.Document.InsertReadOnlyRange(start, end);

Would this be equivalent the equivalent update?

1.RadDocumentEditor _radDocEditor = new RadDocumentEditor(editor.Document);
2._radDocEditor.Document.Selection.AddSelectionStart(start);
3._radDocEditor.Document.Selection.AddSelectionEnd(end);
4._radDocEditor.InsertReadOnlyRange();
Pavel
Top achievements
Rank 1
 answered on 14 Jun 2019
1 answer
188 views

Hello, I am trying to convert my existing C# program from the real Microsoft WPF components to the Telerik components. Now I have the problem that I use the function DataGrid.Items.GetItemAt with the Microsoft components. What is the equivalent in Telerik RadGridView?

Thank you in advance

Ivan Ivanov
Telerik team
 answered on 14 Jun 2019
2 answers
152 views

When a user drags a tab out of a host TabbedWindow it creates a new TabbedWindow to host the Tab but this new TabbedWindow  doesn't inherit the configuration of the original parent. 

What would be the best way to get a handle on this new TabbedWindow and apply configuration style. E.g. disable the new tab button. 

Thanks,

Richard

(PS. I love this new control, it has really helped me)

Richard
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 14 Jun 2019
5 answers
210 views

Is there a way to enable WPF RadDock to open floated windows in a standalone window rather than a ToolWindow? The feature looks like its available in the WinForms version of RadDock but not WPF RadDock.

Would this be achieved in the DockingPanesFactory?

 

<telerik:RadDocking Grid.Row="2" x:Name="radDocking"<br>                            prism:RegionManager.RegionName="DocumentsRegion"<br>                            BorderThickness="0"<br>                            CustomElementLoading="RadDocking_CustomElementLoading"<br>                            HasDocumentHost="False"><br>            <br>            <telerik:RadDocking.DockingPanesFactory><br>                <local1:ShellDockingPanesFactory /><br>            </telerik:RadDocking.DockingPanesFactory><br><br>            <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft"><br>                <telerik:RadPaneGroup HorizontalAlignment="Left"  x:Name="leftGroup" telerik:RadDocking.SerializationTag="leftGroup"/><br>            </telerik:RadSplitContainer><br>            <telerik:RadSplitContainer InitialPosition="DockedRight" ><br>                <telerik:RadPaneGroup HorizontalAlignment="Right" x:Name="rightGroup" telerik:RadDocking.SerializationTag="rightGroup"/><br>            </telerik:RadSplitContainer><br>            <telerik:RadSplitContainer InitialPosition="DockedBottom" ><br>                <telerik:RadPaneGroup x:Name="bottomGroup" telerik:RadDocking.SerializationTag="bottomGroup"/><br>            </telerik:RadSplitContainer><br>            <telerik:RadSplitContainer InitialPosition="FloatingOnly" ><br>                <telerik:RadPaneGroup x:Name="floatingOnlyGroup" telerik:RadDocking.SerializationTag="floatingOnlyGroup"/>   <br>            </telerik:RadSplitContainer><br>            <telerik:RadSplitContainer InitialPosition="FloatingDockable" ><br>                <telerik:RadPaneGroup x:Name="floatingDockableGroup" telerik:RadDocking.SerializationTag="floatingDockableGroup"/><br>            </telerik:RadSplitContainer><br>         <br>        </telerik:RadDocking>

 

<p>public class ShellDockingPanesFactory : DockingPanesFactory<br>    {<br>        <br>        protected override void AddPane(RadDocking radDocking, RadPane pane)<br>        {<br>           <br>            var paneModel = pane as IPaneModel;<br>            if (paneModel != null && !(pane is RadDocumentPane))<br>            {<br>                RadPaneGroup group = null;<br>                switch (paneModel.Position)<br>                {<br>                    case DockState.DockedRight:<br>                        group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "rightGroup") as RadPaneGroup;<br>                        if (group != null)<br>                        {<br>                            group.Items.Add(pane);<br>                        }<br>                        return;<br>                    case DockState.DockedBottom:<br>                        group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "bottomGroup") as RadPaneGroup;<br>                        if (group != null)<br>                        {<br>                            group.Items.Add(pane);<br>                        }<br>                        return;<br>                    case DockState.DockedLeft:<br>                        group = radDocking.SplitItems.ToList().FirstOrDefault(i => i.Control.Name == "leftGroup") as RadPaneGroup;<br>                        if (group != null)<br>                        {<br>                            group.Items.Add(pane);<br>                        }<br>                        return;<br>                    case DockState.FloatingOnly:<br>                        var foSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer();<br>                        group = radDocking.GeneratedItemsFactory.CreatePaneGroup();<br>                        foSplitContainer.Items.Add(group);<br>                        group.Items.Add(pane);<br>                        radDocking.Items.Add(foSplitContainer);<br>                        pane.MakeFloatingOnly();<br>                        return;<br>                    case DockState.FloatingDockable:<br>                        var fdSplitContainer = radDocking.GeneratedItemsFactory.CreateSplitContainer();<br>                        group = radDocking.GeneratedItemsFactory.CreatePaneGroup();<br>                        fdSplitContainer.Items.Add(group);<br>                        group.Items.Add(pane);<br>                        radDocking.Items.Add(fdSplitContainer);<br>                        pane.MakeFloatingDockable();<br>                        return;<br>                    case DockState.DockedTop:<br>                    default:<br>                        return;<br>                }<br>            }<br>           base.AddPane(radDocking, pane);<br>        }<br>    }</p><p></p>

 

Dilyan Traykov
Telerik team
 answered on 14 Jun 2019
9 answers
546 views

Hi,

I'm able to reproduce this error "Cannot change or check the contents or Current position of the QueryableCollectionView while Refresh is being deferred" even on the latest release. The exception is caught only if we use exceptional handling (try, catch).  

I'm using QueryableDataServiceCollectionView with autoload set to true. Now, I am using DeferRefresh() to defer the irrelevant web requests that go out  when I make any changes on RadGridView (i.e changing sort, filter descriptors and column index). 

My problem here occurs when we are trying to change the index of the gridview column. The process is exiting from the PersistenceManager.Load() operation (because of the exception) and skipping the remaining part of execution. Henceforth, it also exits the DeferRefresh() which in turn sends out an irrelevant query to the database, overriding my gridview with different data.

In the sample project that I'm attaching, I couldn't reproduce the same situation by using QueryableDataServiceCollectionView as it needs a DataServiceContext and DataServiceQuery. 

Please provide any fix for this exception.

Here is the link to my sample project: 

https://hexmet-my.sharepoint.com/:u:/g/personal/shravya_kusuma_hexagon_com/EXier5S_YydBr9eljF9NN64BCFM_TUqJQ73F5ojPxDM15Q

Thanks,

Mohan.

Vladimir Stoyanov
Telerik team
 answered on 13 Jun 2019
6 answers
300 views

I've got a RadCartesianChart3D that uses a SurfaceSeries3D to show a colorized surface I've attached a sample image to show how it looks now ("Current_Surface.png")

  1. I colorize this surface using  a SurfaceSeries3dValueGradientColorizer.
  2. I build the colorizer in code-behind one single time.  It consists of 64 hard-coded color values that I use to colorize the my surface.
  3. The gradient stops are evenly distributed throughout the 0.0 to 1.0 range.  I just manually set each GradientStop's "Offset" value to be (1.0 / 64.0) apart

This all works very well and looks great.  It produces the image I referred to above.

Here is the XAML I use. 

<tk:RadCartesianChart3D.Series>
     <tk:SurfaceSeries3D ItemsSource="{Binding Points}"
                         XValueBinding="X"
                         YValueBinding="Y"
                         ZValueBinding="Z"
                         x:Name="Series"                                   
                         >
 
         <tk:SurfaceSeries3D.Colorizer>
             <tk:SurfaceSeries3DValueGradientColorizer x:Name="Colorizer" IsAbsolute="False" />
         </tk:SurfaceSeries3D.Colorizer>
     </tk:SurfaceSeries3D>
</tk:RadCartesianChart3D.Series>

And here is how my XAML builds the GradientStops

// "Colors" is an array of 64 custom colors.
// Return an evenly distributed array of them for gradient stops.
 
 var step = 1.0 / Colors.Length;
 var stops = Colors.Select((color, index) => new GradientStop(color, index * step));
 return new GradientStopCollection(stops);

 

But now I have a new requirement.  I need to add a RadSlider that allows the user to dynamically change the colors instantaneously.  The slider sets "cut-off" values distribution of the colors, limiting the range to a subset of 1.0.  The visual effect is to highlight certain values.  Basically I am emulating something that is already done  a different application of ours (that app uses OpenGL).  

To illustrate, I have also attached an image ("Desired_Surface.png") of this alternate application (the one that already has this slider) and the same surface showing.     You can see the the user has adjusted the bottom slider upwards and this has totally compressed the color distribution.  (You can even see the compressed distribution in the slider itself, though I don't need that). 

My problem is that I cannot see how to emulate this with SurfaceSeries3D without using Deferred Dragging .   The user needs to see the colors change immediately as he/she adjusted either of the sliders indicators;  But the only way I can see to implement this is far too slow for anything but deferred dragging.

First I tried binding the Colorizer's GradientStop property.  As you no doubt already know, that is not allowed by WPF

 

<tk:SurfaceSeries3D.Colorizer>
    <tk:SurfaceSeries3DValueGradientColorizer IsAbsolute="False" GradientStops="{Binding GradientStops}"/>

 

Then I tried declaring all 64 gradient stops directly in XAML and binding each one's GradientStop.Offset to a backing view-model property but that is also not allowed (because Gradient stops must be Freezable and always sorted)

<tk:SurfaceSeries3D.Colorizer>
    <tk:SurfaceSeries3DValueGradientColorizer IsAbsolute="False">
 
        <tk:SurfaceSeries3DValueGradientColorizer.GradientStops>
            <GradientStopCollection>
                <GradientStop Color="sc# 1.0,    0.0,    0.0, 0.5625" Offset="{Binding Offset_0}"/>
                <GradientStop Color="sc# 1.0,    0.0,    0.0, 0.6250" Offset="{Binding Offset_1}"/>

So the only way I could get this working was to completely rebuild the entire Colorizer every single time the user adjusts the slider.  I construct 64 new Gradient stops with the new Offset values and put them into a new GradientStop collection.  Unfortunately, this is far, far too laggy and slow.  It's too much work to do for a slider drag.  So I am left with using deferred dragging.  But that's not what my boss wants.

Is there any other approach I might take to speed up the adjustment of the colors? 

 


Martin Ivanov
Telerik team
 answered on 12 Jun 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?