Telerik Forums
UI for WPF Forum
10 answers
519 views

Hello,

See below code. I need help with the following 2 items:

1. In ControlTemplate the RadGridView has IsReadyOnly=true but for "Select" column (checkbox) I want the IsReadOnly=false

2. AllowMultipleSelection="True" for the Combobox but the DisplayMemberPath is not showing the multiple names selected (from the ControlTemplate)

===========================================================================================================

<UserControl x:Class="DropDownWithHeaders.Example"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
mc:Ignorable="d"
DataContext="{StaticResource ViewModel}"
d:DesignHeight="300" d:DesignWidth="300">
<StackPanel>
<StackPanel Margin="10">
<TextBlock Text="NonEditable ComboBox" />
<telerik:RadComboBox x:Name="nonEditableCombo"
MinWidth="300"
HorizontalAlignment="Left"
ItemsSource="{Binding Materials}"
NonEditableTemplate="{StaticResource NonEditableComboBox}"
DisplayMemberPath="Name"
VerticalAlignment="Top"
StaysOpenOnEdit="True"
AllowMultipleSelection="True"
SelectedItem="{Binding SelectedMaterial, Mode=TwoWay}">
</telerik:RadComboBox>
</StackPanel>
</StackPanel>
</UserControl>

===========================================================================================================

<ControlTemplate x:Key="NonEditableComboBox" TargetType="telerik:RadComboBox">
                <Grid x:Name="VisualRoot">
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Disabled">
                                <Storyboard>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                                        <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.5"/>
                                    </DoubleAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Opacity">
                                        <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.5"/>
                                    </DoubleAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_Disabled}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_Disabled}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="RenderEnabled">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <sys:Boolean>False</sys:Boolean>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="Opacity">
                                        <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.6"/>
                                    </DoubleAnimationUsingKeyFrames>
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledBorder" Storyboard.TargetProperty="Opacity">
                                        <DiscreteDoubleKeyFrame KeyTime="0" Value="1"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="RenderMouseOver">
                                        <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                            <DiscreteObjectKeyFrame.Value>
                                                <sys:Boolean>True</sys:Boolean>
                                            </DiscreteObjectKeyFrame.Value>
                                        </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_MouseOver}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_MouseOver}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="DropDownOpen">
                                <Storyboard>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Foreground">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconForeground_Pressed}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DropDownIcon" Storyboard.TargetProperty="Background">
                                        <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ButtonIconBackground_Pressed}"/>
                                    </ObjectAnimationUsingKeyFrames>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="FocusStates">
                            <VisualState x:Name="Focused"/>
                            <VisualState x:Name="Unfocused"/>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Border IsHitTestVisible="False" Background="{TemplateBinding Background}" CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"/>
                    <telerik:RadToggleButton x:Name="PART_DropDownButton" Foreground="{TemplateBinding Foreground}" IsTabStop="False" Margin="0" Padding="0" ClickMode="Press">
                        <telerik:RadToggleButton.Template>
                            <ControlTemplate TargetType="telerik:RadToggleButton">
                                <ContentPresenter/>
                            </ControlTemplate>
                        </telerik:RadToggleButton.Template>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                           
                            <Border x:Name="DisabledBorder"
                                    IsHitTestVisible="False"
                                    BorderBrush="{StaticResource ControlOuterBorder_Disabled}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Opacity="0"
                                    CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"
                                    Grid.ColumnSpan="2"/>
                           
                            <telerikChromes:ButtonChrome x:Name="ButtonChrome"
                                    Grid.ColumnSpan="2"
                                    CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    RenderPressed="{TemplateBinding IsDropDownOpen}"
                                    RenderFocused="{TemplateBinding IsFocused}"
                                    RenderEnabled="{TemplateBinding IsEnabled}"
                                    RenderMouseOver="{TemplateBinding IsMouseOver}"/>
                           
                            <Border Grid.ColumnSpan="2"
                                    Background="{TemplateBinding Background}"
                                    IsHitTestVisible="False"
                                    CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"
                                    Margin="1"/>
                           
                            <ContentControl x:Name="DropDownIcon"
                                    Grid.Column="1"
                                    IsTabStop="False"
                                    Foreground="{StaticResource ButtonIconForeground_Normal}"
                                    Background="{StaticResource ButtonIconBackground_Normal}"
                                    Template="{StaticResource ArrowTemplateNonEditableCombobox}"/>
                           
                            <ContentPresenter x:Name="Content"
                                    Grid.Column="0"
                                    Margin="{TemplateBinding Padding}"
                                    IsHitTestVisible="False"
                                    Content="{TemplateBinding SelectionBoxItem}"
                                    ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Grid>
                    </telerik:RadToggleButton>
                    <Popup x:Name="PART_Popup">
                        <Grid x:Name="PopupRoot">
                            <Border
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    MinWidth="{TemplateBinding MinDropDownWidth}"
                                    MaxHeight="{TemplateBinding MaxDropDownHeight}"
                                    Background="{StaticResource PickerPopupBackground}"
                                    CornerRadius="{StaticResource SplitButton_SpanCornerRadius}"
                                    x:Name="PART_ResizeBorder">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*"/>
                                    </Grid.RowDefinitions>
                                    <telerik:RadButton x:Name="PART_ClearButton"
                                            Grid.Row="0"
                                            Margin="-1 -1 -1 0"
                                            Visibility="{TemplateBinding ClearSelectionButtonVisibility}"
                                            Content="{TemplateBinding ClearSelectionButtonContent}"/>
                                    <ScrollViewer x:Name="PART_ScrollViewer"
                                            Grid.Row="1"
                                            Foreground="{TemplateBinding Foreground}"
                                            Padding="0 1 0 0"
                                            BorderThickness="0"
                                            HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
                                            VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
                                            CanContentScroll="True">
                                            <!--<ItemsPresenter/>-->
                                        <telerik:RadGridView ItemsSource="{Binding ItemsSource, RelativeSource={RelativeSource TemplatedParent}}"
                                                                 RowIndicatorVisibility="Collapsed"
                                                                 EnableLostFocusSelectedState="False"
                                                                 SelectedItem="{Binding SelectedItem, RelativeSource={RelativeSource TemplatedParent}}"
                                                                 ShowGroupPanel="False" IsFilteringAllowed="False" IsReadOnly="False"
                                                                 DataLoaded="RadGridView_DataLoaded" />
                                    </ScrollViewer>
                                </Grid>
                            </Border>
                        </Grid>
                    </Popup>
                </Grid>
            </ControlTemplate>

 

private void RadGridView_DataLoaded(object sender, EventArgs e)
{
var radGridViewobj = (sender as RadGridView);
List<string> colNames = new List<string>();
foreach(Telerik.Windows.Controls.GridViewColumn column in radGridViewobj.Columns)
{
if (column is GridViewDataColumn)
{
var currentCol = column as GridViewDataColumn;
if (currentCol.DataType.Equals(typeof(bool)))
currentCol.IsReadOnly = false;
}
}
}

===========================================================================================================

public class ViewModel: ViewModelBase
{
public ObservableCollection<Material> Materials { get; set; }
public ViewModel()
{
this.Materials = new ObservableCollection<Material>
{
new Material { Select=false, Id = 1, Name = "Item 1", Type = "Material Type 1", Description="Description 1" },
new Material { Select=true, Id = 2, Name = "Item 2", Type = "Material Type 2", Description="Description 2" },
new Material { Select=true, Id = 3, Name = "Item 3", Type = "Material Type 3", Description="Description 3" },
new Material { Select=false, Id = 4, Name = "Item 4", Type = "Material Type 4", Description="Description 4" },
new Material { Select=true, Id = 5, Name = "Item 5", Type = "Material Type 5", Description="Description 5" },
};
}
private Material selectedMaterial;
public Material SelectedMaterial
{
get
{
return this.selectedMaterial;
}
set
{
if (this.selectedMaterial != value)
{
this.selectedMaterial = value;
this.OnPropertyChanged(() => this.SelectedMaterial);
}
}
}
}

===========================================================================================================

public class Material
{
public bool Select { get; set; }
public int Id { get; set; }
public string Name { get; set; }
public string Type { get; set; }
public string Description { get; set; }
}

===========================================================================================================

 

Thanks,

Sri

Sri
Top achievements
Rank 1
 answered on 07 May 2018
2 answers
105 views

Hello, 

 I have two custom shapes. One contains the other. When I resize the principal in the diagram, I resize manually in the code the secundary. The problem is that I can not selected the principal shape if the size is little. If I don't resize de secundari, the resized works correctly. 

 

The code of resize is: 

"this" is the principal shape ( RadDiagramShape)

"wire" is the secundari shape ( RadDiagramShape)

private void PositionShape_SizeChanged(object sender, SizeChangedEventArgs e)
{
    this.Border = (OriginalStrokeThickness / Scale);
    this.OriginalWidth = e.NewSize.Width / Scale;
    this.OriginalHeight = e.NewSize.Height / Scale;
 
    this.OriginalPosition = new Point(this.Position.X / Scale, this.Position.Y / Scale);
 
    if (e.PreviousSize.Width != 0 && e.PreviousSize.Height != 0)
    {
        switch (OrientaActual)
        {
            case 'N':
           this.Wire.WireHeight = (this.OriginalHeight * 2)*Scale;
                this.Wire.WireWidth = this.OriginalWidth*Scale;
                this.Wire.WirePosition = new Point(this.Position.X, this.Position.Y - this.Wire.Height);
                break;
            case 'E':
                this.Wire.WireHeight = (this.OriginalHeight * 2)*Scale;
                this.Wire.WireWidth = this.OriginalWidth*Scale;
                    this.Wire.WirePosition = new Point(this.Position.X + this.Height * 1.5, this.Position.Y - this.Height / 2);
                break;
            case 'S':
                this.Wire.WireHeight = (this.OriginalHeight * 2)*Scale;
                this.Wire.WireWidth = this.OriginalWidth*Scale;                    
                this.Wire.WirePosition = new Point(this.Position.X, (this.Position.Y + this.Height));
                break;
           case 'W':
               this.Wire.WireHeight = (this.OriginalHeight * 2)*Scale;
                this.Wire.WireWidth = this.OriginalWidth*Scale;
                this.Wire.WirePosition = new Point((this.Position.X - this.Width / 2) - this.Wire.Width, this.Position.Y- this.Height / 2);
                break;
                }  
            }
        }
Dinko | Tech Support Engineer
Telerik team
 answered on 07 May 2018
5 answers
362 views
Is there a way to change the Fluent Colours while the application is running? I can change the colours to custom colours using FluentPalette.Palette.MainColor during the constructor of my rad window, but it doesn't seem to have an effect if I try and change them while the application is already running (to let the user pick their colour theme).
Jason
Top achievements
Rank 1
 answered on 04 May 2018
6 answers
199 views

I'm adding objects of different types to a virtualization source during the MapItemsRequest call. I'm now trying to format them differently based on their DataType. With a normal control, I can do this:

<Window.Resources>
    <DataTemplate DataType="{x:Type local:Dog}">
        <StackPanel>
            <TextBlock Text="{Binding Path=Name}" Background="Green" />
        </StackPanel>
    </DataTemplate>
    <DataTemplate DataType="{x:Type local:Cat}">
        <StackPanel>
            <TextBlock Text="{Binding Path=Name}" Background="Red" />
        </StackPanel>
    </DataTemplate>
</Window.Resources>
<Grid>
    <ListBox Width="400" Margin="10" ItemsSource="{Binding ListItems}" />
</Grid>

 

However when using a VisualizationLayer, nothing happens. It seems to be unable to select my templates. Do I have to create template selector in code? I was trying to do everything in XAML.

Jason D
Top achievements
Rank 1
Veteran
 answered on 04 May 2018
7 answers
230 views

Hi,

I would like to restrict the start and end at the original value during drag and drop appointment.

I just need to change the slot by dragging.

How can i do that.

thanks in advance.

 

 

Stefan
Telerik team
 answered on 03 May 2018
1 answer
120 views

In my VB.Net WPF application I am creating a CartesianCustomLineAnnotation using code behind.  This is working well.

I have not been able to figure out how to display some type of marker (round circle) at the Start and End point of the Custom Line Annotation.  Can anyone provide a recommendation how to achieve this functionality?

Thanks in advance.

Martin Ivanov
Telerik team
 answered on 03 May 2018
1 answer
50 views

Hi

I need to display some alerts (4-5 at a time);
The alerts are displayed correctly, only that during the hiding phase it blocks the whole program.
here is the code (example):

private void DisplayToastForPinUp(int userId)
        {

            RadDesktopAlertManager manager = new RadDesktopAlertManager();
            manager.CloseAllAlerts();
            manager.AlertsReorderAnimationDuration = 1000;
            var pinups = pinUpService.GetAllByUserIdAndDateToRemembre(userId,DateTime.Now);
            foreach (PinUp pinUp in pinups)
            {
                var alert = new RadDesktopAlert();
                alert.Header = "Post: " + pinUp.Title.Trim(); ;
                alert.Content = pinUp.MemoText;
                alert.ShowDuration = 3000;
                manager.ShowAlert(alert);
            }
        }

 

how can I solve it?
thank you

 

 

 

Gianfranco
Top achievements
Rank 1
 answered on 02 May 2018
2 answers
55 views

Hello,

I wrote a simple WPF application which uses Telerik's (2016.1.217.45) RadPane.

The pane contains a User control.

This user control contains a LED image. 

When the user control is displayed without pane, the image is OK.

But - When the user control is displayed inside a pane, the image is cut off at its left side.

Can you please help ?

How can I attach a zip with the project ?

Thank you,

Zvika 

Dinko | Tech Support Engineer
Telerik team
 answered on 02 May 2018
1 answer
222 views

Hi,

I need to dynamically modify the date and time format displayed by a RadDateTimePicker, in the InputBox and the Clock view.

I am able to change the format of the date and time displayed in the Input box using this code:

                    var culture = new CultureInfo("en-US"); // or "fr-FR"
                    var dtfInfo = new DateTimeFormatInfo();
                    dtfInfo.ShortDatePattern = "M/d/yyyy"; // or "yyyy-MM-dd" for fr-FR
                    dtfInfo.LongDatePattern = "M/d/yyyy";  // idem
                    dtfInfo.DateSeparator = "/"; // "-" for fr-FR
                    dtfInfo.ShortTimePattern = "h:mm tt"; // HH:mm for fr-FR
                    dtfInfo.LongTimePattern = "h:mm tt"; // idem
                    dtfInfo.TimeSeparator = ":";
                    culture.DateTimeFormat = dtfInfo;
                    System.Threading.Thread.CurrentThread.CurrentCulture = culture;
                    System.Threading.Thread.CurrentThread.CurrentUICulture = culture;

However, it seems this code has no effect on the format of the time items displayed by the Clock view , opened after the change of date and time patterns.

How to customize the formatting of the time items displayed in the Clock ?  

I am testing with either "en-US" or "fr-FR" cultures.

Thx,

Alain

 

Vladimir Stoyanov
Telerik team
 answered on 02 May 2018
8 answers
168 views

Hello Telerik,

 

I'm using a RadDiagram with a custom template for RadDiagramConnection. The function of this template is to rotate some text linked to the connector.

The following code is the style of my custom RadDiagramConnection :

<Style TargetType="diagramscontrols:RadDiagramConnection" x:Key="RadDiagramConnectionStyle_RotateText">
  <!--<Setter Property="Background" Value="{StaticResource DiagramShape_Connection_Background}"/>
  <Setter Property="Stroke" Value="{StaticResource DiagramShape_Connection_BorderBrush}"/>-->
  <Setter Property="StrokeThickness" Value="1"/>
  <!--<Setter Property="ZIndex" Value="{StaticResource connectionZIndex}"/>-->
  <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="diagramscontrols:RadDiagramConnection">
        <Grid x:Name="RootTemplate" MinHeight="0" HorizontalAlignment="Stretch">
          <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="SelectionStates">
              <VisualState x:Name="Selected"/>
              <VisualState x:Name="SelectedInGroup">
                <Storyboard>
                  <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SelectedInGroupPath" Storyboard.TargetProperty="Visibility" Duration="0">
                    <DiscreteObjectKeyFrame KeyTime="0">
                      <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                      </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                  </ObjectAnimationUsingKeyFrames>
                </Storyboard>
              </VisualState>
              <VisualState x:Name="Unselected"/>
              <VisualState x:Name="SelectedAsGroup"/>
            </VisualStateGroup>
            <VisualStateGroup x:Name="EditMode">
              <VisualState x:Name="NormalMode"/>
              <VisualState x:Name="NormalEditMode">
                <Storyboard>
                  <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                    <DiscreteObjectKeyFrame KeyTime="0">
                      <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                      </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                  </ObjectAnimationUsingKeyFrames>
                  <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditContent" Storyboard.TargetProperty="Visibility">
                    <DiscreteObjectKeyFrame KeyTime="0">
                      <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                      </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                  </ObjectAnimationUsingKeyFrames>
                </Storyboard>
              </VisualState>
              <VisualState x:Name="TextBoxEditMode">
                <Storyboard>
                  <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="NormalContent" Storyboard.TargetProperty="Visibility">
                    <DiscreteObjectKeyFrame KeyTime="0">
                      <DiscreteObjectKeyFrame.Value>
                        <Visibility>Collapsed</Visibility>
                      </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                  </ObjectAnimationUsingKeyFrames>
                  <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetName="EditTextBox" Storyboard.TargetProperty="Visibility">
                    <DiscreteObjectKeyFrame KeyTime="0">
                      <DiscreteObjectKeyFrame.Value>
                        <Visibility>Visible</Visibility>
                      </DiscreteObjectKeyFrame.Value>
                    </DiscreteObjectKeyFrame>
                  </ObjectAnimationUsingKeyFrames>
                </Storyboard>
              </VisualState>
            </VisualStateGroup>
          </VisualStateManager.VisualStateGroups>
 
          <Path x:Name="DeferredPath"
                Stroke="{TemplateBinding Stroke}"
                Opacity="0.7"
                Fill="{TemplateBinding Background}"
                StrokeThickness="{TemplateBinding StrokeThickness}"
                StrokeDashArray="2 2"/>
          <Path x:Name="SelectedInGroupPath" Visibility="Collapsed" Stroke="{StaticResource DiagramShape_Selected_BorderBrush}" />
          <Path Stroke="{TemplateBinding Stroke}"
                Fill="{TemplateBinding Background}"
                StrokeThickness="{TemplateBinding StrokeThickness}"
                x:Name="GeometryPath"
                StrokeDashArray="{TemplateBinding StrokeDashArray}"/>
          <Grid x:Name="EdittingElement" RenderTransformOrigin="0.5 0.5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <!--TextBlock.TextAlignment="{Binding Tag.TextAlignement, RelativeSource={RelativeSource AncestorType=diagramscontrols:RadDiagramConnection}}"-->
            <Grid.RenderTransform>
              <RotateTransform>
                <RotateTransform.Angle>
                  <MultiBinding Converter="{StaticResource BoundsToAngleConverter}">
                    <Binding Path="StartPoint" RelativeSource="{RelativeSource AncestorType=diagramscontrols:RadDiagramConnection}" />
                    <Binding Path="EndPoint" RelativeSource="{RelativeSource AncestorType=diagramscontrols:RadDiagramConnection}" />
                  </MultiBinding>
                </RotateTransform.Angle>
              </RotateTransform>
            </Grid.RenderTransform>
            <Border Background="Transparent"/>
            <TextBlock x:Name="NormalContent" Foreground="{TemplateBinding Foreground}"
                       FontFamily="{TemplateBinding FontFamily}"
                       FontSize="{TemplateBinding FontSize}"
                       Text="{TemplateBinding Content}"
                       TextAlignment="{Binding Tag.TextAlignement, RelativeSource={RelativeSource AncestorType=diagramscontrols:RadDiagramConnection}}"
                       HorizontalAlignment="{Binding Tag.HorizontalTextAlignement, RelativeSource={RelativeSource AncestorType=diagramscontrols:RadDiagramConnection}}"
                       VerticalAlignment="Center" />
 
 
            <!--<ContentPresenter x:Name="NormalContent" />-->
            <ContentPresenter x:Name="EditContent" Visibility="Collapsed" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding EditTemplate}"/>
            <TextBox x:Name="EditTextBox" Visibility="Collapsed" Style="{StaticResource EditTextBoxStyle_Connection}" >
              <TextBox.InputBindings>
                <KeyBinding Key="Enter" Command="ApplicationCommands.NotACommand"/>
              </TextBox.InputBindings>
            </TextBox>
          </Grid>
        </Grid>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>

 

However, I want that the text will be above of the connector. Moreover, I have some bad behaviors depending on the position of the Connector. I attached a file (arrowTexts) to show you these bad behaviors. Tell me if you want more examples.

 

I want to know if you can help me to find a solution to have the good text position.

 

Thank you very much !

Martin Ivanov
Telerik team
 answered on 02 May 2018
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?