Telerik Forums
UI for WPF Forum
0 answers
27 views

Hello

Please check the attached file: contextmenu.png
I want the 1st row icon column to have Padding=0,0 and Margin=0,0,0,0

Waiting for your reply

anna
Top achievements
Rank 1
Bronze
Iron
 updated question on 28 Apr 2025
2 answers
32 views

Hi,

how can we hide the Navigation Options from the RadOfficeNavigationBar?

<telerik:RadOfficeNavigationBar>
    <telerik:RadOfficeNavigationBarItem Content="{lex:Loc Key=EditCommandText}" 
                                        Command="{Binding EditCommand}" >
        <telerik:RadOfficeNavigationBarItem.Style>
            <Style TargetType="telerik:RadOfficeNavigationBarItem">
                <Setter Property="Visibility" Value="Visible" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding FormMode}" Value="{x:Static tim:FormMode.Modify}">
                        <Setter Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </telerik:RadOfficeNavigationBarItem.Style>
    </telerik:RadOfficeNavigationBarItem>
    <telerik:RadOfficeNavigationBarItem Content="{lex:Loc Key=SaveCommandText}" 
                                        Command="{Binding SaveCommand}" >
        <telerik:RadOfficeNavigationBarItem.Style>
            <Style TargetType="telerik:RadOfficeNavigationBarItem">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding FormMode}" Value="{x:Static tim:FormMode.Modify}">
                        <Setter Property="Visibility" Value="Visible" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </telerik:RadOfficeNavigationBarItem.Style>
    </telerik:RadOfficeNavigationBarItem>
    <telerik:RadOfficeNavigationBarItem Content="{lex:Loc Key=CancelCommandText}" 
                                        Command="{Binding CancelCommand}" >
        <telerik:RadOfficeNavigationBarItem.Style>
            <Style TargetType="telerik:RadOfficeNavigationBarItem">
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding FormMode}" Value="{x:Static tim:FormMode.Modify}">
                        <Setter Property="Visibility" Value="Visible" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </telerik:RadOfficeNavigationBarItem.Style>
    </telerik:RadOfficeNavigationBarItem>
</telerik:RadOfficeNavigationBar>

Regards,

Andreas

Andreas
Top achievements
Rank 1
Iron
 answered on 28 Apr 2025
1 answer
51 views

Hello

Question  about ===> public ControlTemplate SeparatorTemplateKey {get;set}

 

I don't know how to use (public ControlTemplate SeparatorTemplateKey {get;set}

). Please teach me.
I don't know how to use (public ControlTemplate SeparatorTemplateKey {get;set}

), so it's very difficult for me.

 

 

<Window.Resources
        <ControlTemplate x:Key="SeparatorTemplate" TargetType="telerik:RadMenuItem"
            <Grid HorizontalAlignment="Stretch">                 
                    <Rectangle Fill="Red" Height="20" Width="1" VerticalAlignment="Stretch"/> 
                    <Rectangle Fill="Blue" Height="20" Width="1" VerticalAlignment="Stretch"/>               
            </Grid
        </ControlTemplate>   
</Window.Resources>     
    
<Grid x:Name="LayoutRoot" Background="White"
        <telerik:RadMenu x:Name="radMenu" ClickToOpen="False" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="8,8,0,0"
            <telerik:RadMenuItem Header="File"/> 
            <telerik:RadMenuItem Header="Edit" IsSeparator="True" Template="{StaticResource SeparatorTemplate}" />              
            <telerik:RadMenuItem Header="View" />            
        </telerik:RadMenu

</Grid>

 

 

--------

using System.Windows.Controls;
public override ObservableCollection<MenuItem> GetMenu()
{
    var contextmenuitem = new ObservableCollection<MenuItem>(); 
    var eRNode = crateMenuItem("Report");
    eRNode.Items.Add(createMenuItem("Sub"));
  
    contextmenuitem.Add(Separate); <===
    ControlTemplate template = new ControlTemplate();
    template.key = "Tamplate";
    contextmenuitem.Add(SeparatorTemplateKey(template)); <===ControlTemplate x:Key="Template" OF XAML.xaml File .... <==I don't know grammar. How do I write code?
    contextmenuitem.Add(eRNode);
}

 

 

 

 

Martin Ivanov
Telerik team
 answered on 28 Apr 2025
0 answers
45 views

WPF, RadContextMenu

Is there a way to display different colors in the RadContextMenu ?

Display RadContextMenu various colors based on the Separator of RadContextMenu.

In RadContextMenu,

Also, can you set the image margin(or icon margin) to 0?

Please check the attached file : RadContextMenu2WPF.png, RadContextMenu1WPF.png

anna
Top achievements
Rank 1
Bronze
Iron
 asked on 17 Apr 2025
1 answer
39 views

Hi Team,

We have developer license for the Telerik UI for WPF product, however we are unable to get the developer MSI for the Telerik UI for WPF 2024.1.130.45. Only the trial version is visible now.

Could you please guide us to get the dev  version of 2024.1.130.45? 

Martin Ivanov
Telerik team
 answered on 16 Apr 2025
0 answers
26 views

Hello Telerik Team,

I'm working with the RadDiagram control and have a scenario where I need certain RadDiagramShapes to display their AdditionalContent persistently â€“ meaning the content should remain visible even when the shape is not selected. Additionally, I want to achieve this behavior and customize the AdditionalContent's styling purely through MVVM binding approaches.

Could you please provide guidance or code examples demonstrating:

  1. How to keep AdditionalContent visible for specific shapes regardless of selection state.
  2. How to dynamically style AdditionalContent (e.g., colors, templates) using MVVM properties.

Any suggestions for binding strategies or relevant Shape/Style properties would be greatly appreciated. Thank you!

Joey
Top achievements
Rank 1
 asked on 16 Apr 2025
1 answer
30 views

Hi,

I tried to combine the 2 telerik examples related to RadTreeviews - the RadTreeView as File Explorer and that from SDK repo related to drag and drop between 2 Radtreeview.

I finally succeeded to make an working short program, but I don't know why by dragging a file from one tree to another, the UI of the second tree shows the dropped file twice - even the Tree ItemsSource is correct (only one file dragged and dropped)

after Puplating the trees,I used DragDropMAnager and the following classes (as they are defined in telerik example, adapted to files/folder structure)

DragDropManager.AddDragOverHandler(this.tree1, OnTree1DragOver, true);
DragDropManager.AddDragOverHandler(this.tree2, OnTree2DragOver, true);
DragDropManager.AddDropHandler(this.tree2, OnTree2Drop, true);

My OnTree2DragOver function:

var options = DragDropPayloadManager.GetDataFromObject(e.Data, TreeViewDragDropOptions.Key) as TreeViewDragDropOptions;
if (options == null)
    return;

// The condition after the first OR operator is needed to deny the drop of items in Application File. (sub-items)
RadTreeViewItem dropTargetItem = options.DropTargetItem;

var draggedItem = options.DraggedItems.First();
if (dropTargetItem == null ||
(dropTargetItem != null &&
     options.DropTargetItem.DataContext is File &&
     options.DropPosition == DropPosition.Inside) ||
    draggedItem is Folder)
{
    options.DropAction = DropAction.None;
}

options.UpdateDragVisual();

 

 

my OnTree2Drop function is:

 var options = DragDropPayloadManager.GetDataFromObject(e.Data, TreeViewDragDropOptions.Key) as TreeViewDragDropOptions;
 if (options == null)
     return;
 File draggedItem = options.DraggedItems.FirstOrDefault() as File;
 if (draggedItem == null)
     return;
 RadTreeViewItem dropTargetItem = options.DropTargetItem;
 if (dropTargetItem == null)
     return;
 var dropItemModel = dropTargetItem.DataContext;
 if (dropItemModel == null)
     return;
 var dropTree = sender as RadTreeView;
 if (dropTree != null)
 {
     // Disable drop in tree2 File.
     if (dropItemModel is File && options.DropAction == DropAction.None)
     {
         e.Handled = true;
         return;
     }
     //Drop in tree2
     if (dropItemModel is Folder || dropItemModel is File)
     {
         options.DropAction = DropAction.Copy;
         //options.UpdateDragVisual();
         Folder destinationFolder = null;
         if (dropItemModel is Folder)
         {
             // Dropping inside Application.
             destinationFolder = dropItemModel as Folder;
         }
         else
         {
             // Dropping Before or After an Application Resource.
             destinationFolder = options.DropTargetItem.ParentItem.DataContext as Folder;
         }
         if (destinationFolder == null)
         {
             return;
         }
         File file = new File()
         {
             Name = draggedItem.Name
         };
         destinationFolder.Items.Add(file);
    
         //options.UpdateDragVisual();
     
         System.IO.File.Copy(@draggedItem.FullPath, System.IO.Path.Combine(@destinationFolder.FullPath, System.IO.Path.GetFileName(@draggedItem.FullPath)));
         options.UpdateDragVisual();

My OnTree1DragOver:

var options = DragDropPayloadManager.GetDataFromObject(e.Data, TreeViewDragDropOptions.Key) as TreeViewDragDropOptions;
if (options != null)
{
    options.DropAction = DropAction.None;
    options.UpdateDragVisual();
    var draggedFile = options.DraggedItems.First() as File;
    e.Handled = true;
}

In the attached picture you'll see Adeliatte Italic.ttf twice, even I dragged and drpped it only once.

Could you please take a short look and tell me what I'm doing wrong?

Or, if it is not too much time consuming for you to come back with an example of 2 treeviews acting as explorer and with d&d functionality?

 

Thank you in advance for your support.

Danny

Danny
Top achievements
Rank 1
Iron
 answered on 14 Apr 2025
0 answers
28 views


This is how my RadStepProgressBar appears for some of the steps.

When I change the Height (or StepSpacing or Margin) of the RadStepProgressBar control in XAML hot reload, the appearance corrects itself.



This doesn't always happen, but only sometimes. I have set the binding for the ItemsSource property of RadStepProgressBar to my steps collection, and set the SelectedIndex using binding whenever a step is completed

What am I doing wrong?
Nikhil
Top achievements
Rank 1
 asked on 14 Apr 2025
1 answer
44 views

<telerik:RadBusyIndicator x:Name="radBusyIndicator"
                          Foreground="#ffffff"
                          IsBusy="{Binding IsBusy}">

 

I use the above when to show the busy indicator while saving.

After it has saved (IsBusy is false) I call Element.Focus(); but it does not focus on the element.
No element shows as being focused.

If I remove the line that sets IsBusy to true the focus works as expected.

Is there a workaround for this problem? 

 

 

Stenly
Telerik team
 answered on 14 Apr 2025
1 answer
55 views
There are several predefined types in RadChat such as Card, Carousel etc. 

Is it possible that I can create a new type or modify an existing type to show my own WPF component?
Martin Ivanov
Telerik team
 answered on 11 Apr 2025
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
Slider
Expander
TileList
PersistenceFramework
DataPager
TimeBar
Styling
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
CardView
DataBar
WebCam
FilePathPicker
Licensing
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?