Telerik Forums
UI for WPF Forum
1 answer
163 views

I'm starting to play around with the Telerik RTB and I was wondering if there was a way to get the word under the mouse cursor?

Tanya
Telerik team
 answered on 24 Apr 2018
1 answer
606 views

Hello,

I'm binding to multiple items using PropertySetMode="Intersection" and CurrentPropertySet.  Changes to the properties from the PropertyGrid combobox work as expected, but changes to the objects from anywhere else in the application do not cause the PropertyGrid to update until the item selection is refreshed.  The objects implement INotifyPropertyChanged.  Is there something else I'm missing to get the changes to be shown in the PropertyGrid?

Here is some of the relevant XAML and my view model:

<DataTemplate x:Key="TemplateComboBoxTemplate">
    <telerik:RadComboBox ItemsSource="{Binding Clubs, Source={StaticResource MyViewModel}}"
                         SelectedValue="{Binding CurrentPropertySet[ClubID], Mode=TwoWay}"
                         SelectedValuePath="ID"
                         DisplayMemberPath="Name"
                         Margin="0">
    </telerik:RadComboBox>
</DataTemplate>
 
<telerik:RadPropertyGrid
    Item="{Binding Players}" 
    PropertySetMode="Intersection"
AutoGeneratePropertyDefinitions="True"
    AutoGeneratingPropertyDefinition="RadPropertyGrid_AutoGeneratingPropertyDefinition"/>

 

public class MyViewModel : INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
 
    private ObservableCollection<Club> clubs;
    private ObservableCollection<Player> players;
    private List<Player> playersTemp = new List<Player>();
 
    public MyViewModel()
    {
        clubs = new ObservableCollection<Club>();
        Club club;
 
        // Liverpool
        club = new Club("Liverpool", new DateTime(1892, 1, 1), 45362, 1);
        club.Players.Add(new Player("Pepe Reina", 25, Position.GK, "Spain", 1, true));
        clubs.Add(club);
 
        // Manchester Utd.
        club = new Club("Manchester Utd.", new DateTime(1878, 1, 1), 76212, 2);
        club.Players.Add(new Player("Edwin van der Sar", 1, Position.GK, "Netherlands", 2, false));
        clubs.Add(club);
 
        // Chelsea
        club = new Club("Chelsea", new DateTime(1905, 1, 1), 42055, 3);
        club.Players.Add(new Player("Petr ÄŒech", 1, Position.GK, "Czech Republic", 3, true));
        clubs.Add(club);
 
        // Arsenal
        club = new Club("Arsenal", new DateTime(1886, 1, 1), 60355, 4);
        club.Players.Add(new Player("Manuel Almunia", 1, Position.GK, "Spain", 4, false));
        clubs.Add(club);
 
        players = new ObservableCollection<Player>(clubs.SelectMany(c => c.Players));
    }
 
    public ObservableCollection<Club> Clubs
    {
        get
        {
            return this.clubs;
        }
    }
 
    public ObservableCollection<Player> Players
    {
        get
        {
            return this.players;
        }
    }
 
    internal void ClearPlayers()
    {
        playersTemp.AddRange(players);
        players.Clear();
        OnPropertyChanged(nameof(Players));
    }
 
    internal void SelectPlayers()
    {
        foreach (var player in playersTemp)
        {
            players.Add(player);
        }
        playersTemp.Clear();
        OnPropertyChanged(nameof(Players));
    }
 
    protected virtual void OnPropertyChanged(PropertyChangedEventArgs args)
    {
        PropertyChangedEventHandler handler = this.PropertyChanged;
        if (handler != null)
        {
            handler(this, args);
        }
    }
 
    private void OnPropertyChanged(string propertyName)
    {
        this.OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
    }
}

I prepared a sample project starting from another sample I found on this forum but I was unable to upload. I can provide this if it helps.

Thanks for any help you can offer!

Vladimir Stoyanov
Telerik team
 answered on 24 Apr 2018
1 answer
165 views

Can diagram be painted on intitialization based on input data ?

if i have list of objects and then for each object will be created shape

thank you

Vladimir Stoyanov
Telerik team
 answered on 24 Apr 2018
4 answers
322 views

Hi,

I am using WPF , MEF, PRISM and Telerik Components RadGrid , RadDataFilter and RadDataPager with the StyleManager.

The Problem i have is in RadDataFilter .If i open the Filter Criterias the Value for Filter is missing in Fluent Dark and Light . But if i only switch the Theme to Win8 it´s there. The Code of my View is below and some Pictures of the visual Tree are in the Attachments.

Is this a Bug in Fluent Styles or mine in xaml ?

In App.xaml.cs i only switch this 2 block of code to see if there is a Field in Win8  and also in Fluent but i can only find it in Win8 Theme correctly.

            //Fluent resources
            FluentPalette.LoadPreset(FluentPalette.ColorVariation.Light);
            FluentPalette.Palette.FontSizeS = 10;
            FluentPalette.Palette.FontSize = 10;
            FluentPalette.Palette.FontSizeL = 12;
            FluentPalette.Palette.FontSizeXL = 14;
            FluentPalette.Palette.FontFamily = new FontFamily("Segoe UI");
            FluentPalette.Palette.CornerRadius = new CornerRadius(5);
            FluentTheme apptheme = new FluentTheme();
            ThemeEffectsHelper.IsAcrylicEnabled = false;
            StyleManager.ApplicationTheme = apptheme;

            //Windows8Touch resources
            //Windows8Palette.Palette.FontSizeS = 8;
            //Windows8Palette.Palette.FontSize = 10;
            //Windows8Palette.Palette.FontSizeL = 12;
            //Windows8Palette.Palette.FontSizeXL = 14;
            //Windows8Palette.Palette.FontSizeXXL = 16;
            //Windows8Palette.Palette.FontFamily = new FontFamily("Courier New");
            //Windows8Palette.Palette.FontFamilyLight = new FontFamily("Courier New");
            //Windows8Palette.Palette.FontFamilyStrong = new FontFamily("Courier New");
            //StyleManager.ApplicationTheme = new Windows8Theme();

If you look into the visual Tree attached pictures it looks like there is something missing under the "Filter Editor" in Fluent Style compared to the same entry in Win8.

I also tried this Styles with different results.

worked ok with Vista => value field is there   with StyleManager.ApplicationTheme = new VistaTheme();

but it´s also missing with => StyleManager.ApplicationTheme = new MaterialTheme();

Any Idea how i can fix this please.

 

Thanks br

Thomas Cinatl

 

 
<UserControl x:Class="MySolutionApplication.Views.LookupListGrid"
             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"
             xmlns:telerikGrid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
             xmlns:Mvvm="clr-namespace:Prism.Mvvm;assembly=Prism.Wpf"
             UseLayoutRounding="True" IsEnabled="True"
             Mvvm:ViewModelLocator.AutoWireViewModel="True"
             mc:Ignorable="d" d:DesignWidth="1022" d:DesignHeight="649"
            >
    <DockPanel>
        <DockPanel.Resources>
                <Style x:Key="CenterCheckBoxColumnCellStyle" TargetType="telerik:GridViewCell">
                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
                </Style>
                <Style x:Key="GridViewHeaderRowStyle" TargetType="{x:Type telerik:GridViewHeaderCell}">
                    <Setter Property="Background"
                        Value="DarkBlue" />
                </Style>
        </DockPanel.Resources>
       
        <TextBlock x:Name="label" Text="{Binding DisplayName,FallbackValue='Lookup'}" Grid.Row="0" Margin="0" HorizontalAlignment="Stretch" Style="{StaticResource HeaderStyle}" VerticalAlignment="Center"
                   DockPanel.Dock="Top"/>
       
        <telerik:RadExpander DockPanel.Dock="Top" Header="SEARCH" FontWeight="Bold">
            <telerik:RadDataFilter x:Name="radDataFilter" Source="{Binding Items, ElementName=LookupListGridCtrl}" >
            </telerik:RadDataFilter>
        </telerik:RadExpander>
       
            <telerik:RadGridView x:Name="LookupListGridCtrl" ItemsSource="{Binding Nodes,Mode=TwoWay}" SelectedItem="{Binding Nodes.SelectedUiDataItem,Mode=TwoWay}"  Grid.Row="1"
                                 AutoGenerateColumns="false" GroupRenderMode="Flat" NewRowPosition="Top"
                                 CanUserDeleteRows="True" ScrollMode="Deferred" IsSynchronizedWithCurrentItem="True" CanUserResizeColumns="True"
                                 RowIndicatorVisibility="Visible" Margin="0,0,0,1"
                                 IsFilteringAllowed="False">

                <telerik:EventToCommandBehavior.EventBindings>
                    <telerik:EventBinding Command="{Binding CommandProvider.DoDeleteRow}" EventName="Deleted" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding CommandProvider.DoInsertRow}" EventName="RowEditEnded" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding CommandProvider.DoAddNew}" EventName="AddingNewDataItem" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding CommandProvider.DoValidatingCell}" EventName="CellValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                    <telerik:EventBinding Command="{Binding CommandProvider.DoValidatingRow}" EventName="RowValidating" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                </telerik:EventToCommandBehavior.EventBindings>

                <telerik:RadGridView.Columns>
                    <telerik:GridViewColumn Header="x" Width="30" HeaderTextAlignment="Center" HeaderCellStyle="{DynamicResource GridViewHeaderRowStyle}" IsFilterable="False"
                                            IsGroupable="False" IsReorderable="False" IsSortable="False" IsResizable="False">
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <telerik:RadButton Command="telerikGrid:RadGridViewCommands.Delete"
                                                   CommandParameter="{Binding}"
                                                   telerik:TouchManager.IsTouchHitTestVisible="False">
                                    <Image Height="15" Width="15" Source="/MySolutionApplication;component/Images/DeleteHS.png"/>
                                </telerik:RadButton>
                            </DataTemplate>
                        </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewColumn>
                    <!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Text: lookup_lkp -->
                    <telerik:GridViewDataColumn Header="LOOKUP"
                                                DataMemberBinding="{Binding lookup_lkp, Mode=TwoWay}"
                                                Width="90*"
                                                TextAlignment="Left"/>
                    <!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Compared with : group_lookup_lkp  IN  :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Lookup: group_lookup_lkp -->
                    <telerik:GridViewComboBoxColumn Header="GROUP LOOKUP" Width="180*"
                                                    DataMemberBinding="{Binding group_lookup_lkp, Mode=TwoWay}"
                                                    DisplayMemberPath="display_nam"
                                                    ItemsSource="{Binding Nodes.GroupLookups}"
                                                    SelectedValueMemberPath="lookup_lkp"
                                                    >
                        <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding display_nam}" TextAlignment="Left"/>
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <!-- Ignore NonList: alias_id -->
                    <!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Compared with : par_lkp_lookup_lkp  IN  :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Lookup: par_lkp_lookup_lkp -->
                    <telerik:GridViewComboBoxColumn Header="PAR LKP LOOKUP" Width="210*"
                                                    DataMemberBinding="{Binding par_lkp_lookup_lkp, Mode=TwoWay}"
                                                    DisplayMemberPath="display_nam"
                                                    ItemsSource="{Binding Nodes.ParLkpLookups}"
                                                    SelectedValueMemberPath="lookup_lkp"
                                                    >
                        <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding display_nam}" TextAlignment="Left"/>
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Compared with : par_lkp_group_lookup_lkp  IN  :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Lookup: par_lkp_group_lookup_lkp -->
                    <telerik:GridViewComboBoxColumn Header="PAR LKP GROUP LOOKUP" Width="300*"
                                                    DataMemberBinding="{Binding par_lkp_group_lookup_lkp, Mode=TwoWay}"
                                                    DisplayMemberPath="display_nam"
                                                    ItemsSource="{Binding Nodes.ParLkpGroupLookups}"
                                                    SelectedValueMemberPath="lookup_lkp"
                                                    >
                        <telerik:GridViewComboBoxColumn.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding display_nam}" TextAlignment="Left"/>
                                </Grid>
                            </DataTemplate>
                        </telerik:GridViewComboBoxColumn.ItemTemplate>
                    </telerik:GridViewComboBoxColumn>
                    <!-- Ignore NonList: external_uri -->
                    <!-- Ignore NonList: customized_flg -->
                    <!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Text: display_nam -->
                    <telerik:GridViewDataColumn Header="DISPLAY"
                                                DataMemberBinding="{Binding display_nam, Mode=TwoWay}"
                                                Width="120*"
                                                TextAlignment="Left"/>
                    <!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Text: display_short_txt -->
                    <telerik:GridViewDataColumn Header="DISPLAY SHORT"
                                                DataMemberBinding="{Binding display_short_txt, Mode=TwoWay}"
                                                Width="195*"
                                                TextAlignment="Left"/>
                    <!-- Ignore NonList: report_txt -->
                    <!-- Ignore NonList: description_txt -->
                    <!-- Ignore Audit: create_user -->
                    <!-- Ignore Audit: create_date -->
                    <!-- Ignore Audit: modify_user -->
                    <!-- Ignore Audit: modify_date -->
                    <!-- Ignore Audit: valid_from -->
                    <!-- Ignore Audit: valid_to -->
                    <!-- Ignore Audit: deleted_yn -->
                    <!-- Compare with : :group_lookup_lkp:ROOT:par_lkp_lookup_lkp:ROOT:par_lkp_group_lookup_lkp:ROOT: -->
                    <!-- Flag: valid_yn -->
                    <telerik:GridViewCheckBoxColumn Header="VALID" DataMemberBinding="{Binding IsValidYn, Mode=TwoWay}"  AutoSelectOnEdit="True" EditTriggers="CellClick" Width="75*" >
                        <telerik:GridViewCheckBoxColumn.CellStyle>
                            <Style TargetType="telerik:GridViewCell" BasedOn="{StaticResource CenterCheckBoxColumnCellStyle}">
                                <Setter Property="HorizontalContentAlignment" Value="Center" />
                            </Style>
                        </telerik:GridViewCheckBoxColumn.CellStyle>
                    </telerik:GridViewCheckBoxColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

            <telerik:RadDataPager PageSize="20"
                                      Grid.Row="2" FontSize="12" Margin="0,-1,0,0"
                                      Source="{Binding Items, ElementName=LookupListGridCtrl}"
                                      IsTotalItemCountFixed="True"
                                      DisplayMode="FirstLastPreviousNextNumeric, Text" />
    <!--</Grid>-->
    </DockPanel>
</UserControl>

Sia
Telerik team
 answered on 24 Apr 2018
0 answers
523 views

Hi

We're using a WPF RadWindow to customize a titlebar with an image and keeping the other behaviors and we application is used in one or two monitors.

After implementation, when restore and maximize in the second monitor, the window's height override the taskbar and exceeds the second monitor and show the RadWindow in the primary monitor.

How correct this problem?

Best Regards

Pierre Voigt

 

OBS:

* The second monitor is above the primary monitor.

* The telerik's version is 2018.1.220.45.

* We're using the Fluent theme.

* Sample:

 

MainWindow.xaml.cs

01.using Telerik.Windows.Controls;
02. 
03.namespace RadWindowSample
04.{
05.    public partial class MainWindow : RadWindow
06.    {
07.        public MainWindow()
08.        {
09.            InitializeComponent();
10.        }
11.    }
12.}

 

MainWindow.xaml

01.<telerik:RadWindow x:Class="RadWindowSample.MainWindow"
07.   xmlns:local="clr-namespace:RadWindowSample"
08.   mc:Ignorable="d"
09.   MinHeight="600"
10.   MaxHeight="900"
11.   MinWidth="900"
12.   WindowState="Maximized"
13.   Height="450" Width="800">
14.    <Grid>
15. 
16.    </Grid>
17.</telerik:RadWindow>

App.xaml.cs

01.using System.Windows;
02. 
03.namespace RadWindowSample
04.{
05.    public partial class App : Application
06.    {
07.        protected override void OnStartup(StartupEventArgs e)
08.        {
09.            var mainWindow = new MainWindow();
10.            mainWindow.Show();
11.            base.OnStartup(e);
12.        }
13.    }
14.}

 

App.xaml

01.<Application x:Class="RadWindowSample.App"
04.    xmlns:local="clr-namespace:RadWindowSample"
05.   >
06.    <Application.Resources>
07.        <ResourceDictionary>
08.            <ResourceDictionary.MergedDictionaries>
09.                <!--Telerik.Windows.Controls is used by all assemblies -->
10.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.xaml" />
11. 
12.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/System.Windows.xaml" />
13.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Input.xaml" />
14. 
15.                <!-- Requires: System.Windows.xaml -->
16.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
17.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Chart.xaml" />
18. 
19.                <!-- Requires: Telerik.Windows.Controls.Input -->
20.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Data.xaml" />
21.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.DataVisualization.xaml" />
22. 
23.                <!-- Requires: Telerik.Windows.Controls.Navigation -->
24.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
25. 
26.                <!-- Requires: Telerik.Windows.Controls.Input -->
27.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
28.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.ImageEditor.xaml" />
29. 
30.                <!-- Requires: Telerik.Windows.Controls.Input, Telerik.Windows.Controls.Navigation -->
31.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.RibbonView.xaml" />
32.                <!--<ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.RibbonView.xaml" />-->
33.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Diagrams.xaml" />
34.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Diagrams.Extensions.xaml" />
35.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Documents.xaml" />
36.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Spreadsheet.xaml" />
37.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.GanttView.xaml" />
38.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Pivot.xaml" />
39.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.PivotFieldList.xaml" />
40. 
41.                <!-- Used for PdfViewerControl -->
42.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.FixedDocumentViewers.xaml" />
43.                <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.FixedDocumentViewersUI.xaml" />
44.            </ResourceDictionary.MergedDictionaries>
45.            <Style TargetType="local:MainWindow" BasedOn="{StaticResource RadWindowStyle}" />
46.        </ResourceDictionary>
47.    </Application.Resources>
48.</Application>
Pierre
Top achievements
Rank 1
 asked on 23 Apr 2018
3 answers
1.4K+ views

I need to set checkbox into GridView checkboxcolumn header to implement "Select all" functionallity.

In wpf DataGrid it was simple i could set HeaderColumnTemplate property in xaml and bind to a DataGrid ViewModel object property. Unfortuantly I could not find simillar property or a way to to implement the functionality i need.

Dinko | Tech Support Engineer
Telerik team
 answered on 23 Apr 2018
6 answers
370 views

Hello Telerik,

 

I'm working with a RadDiagram.

In my case, I have a red rectangle to show to user the limit of the diagram. If he moves a Shape outside of the red rectangle body, we replace the shape inside the rectangle (with an algorithm).

For all shape types, is working find, but not for RadDiagramConnection.

 

My sub :

Private Sub MoveShape(p_shape As RadDiagramItem)
    If (p_shape Is Nothing) Then Exit Sub
 
    If Me._moveShapeCount >= 8 Then 'Used to fix a bug with infinite loop (StackOverFlowException) !
        Me._moveShapeCount = 0
        Exit Sub
    End If
 
    Try
        'Memory
        Dim shapeAsRectangle As Rect = p_shape.GetActualBounds() 'Used to have the good values when shape is rotated
        Dim isRectangleRotated As Boolean = False
        Dim isShapePositionModified As Boolean = False
 
        'Rotation management
        If TryCast(p_shape, RadDiagramShape) IsNot Nothing Then
            'Image / Elipse
            isRectangleRotated = (Not ListMissOutAngles.Exists(Function(a) a = DirectCast(p_shape, RadDiagramShape).RotationAngle))
        ElseIf TryCast(p_shape, RadDiagramConnection) IsNot Nothing Then
            'Me.ReplaceConnectorShape(p_shape) 'Specific treatment because Connection not has rotation angle and can have 2 points inside the line
            'Exit Sub
        ElseIf TryCast(p_shape, RadDiagramTextShape) IsNot Nothing Then
            'Boite de texte
            isRectangleRotated = (Not ListMissOutAngles.Exists(Function(a) a = DirectCast(p_shape, RadDiagramTextShape).RotationAngle))
        Else
            'Kc / Gap / Ref / Calculation / Adiru / FSI
            isRectangleRotated = (Not ListMissOutAngles.Exists(Function(a) a = DirectCast(p_shape, RadDiagramShapeBase).RotationAngle))
        End If
 
        'Width management
        If p_shape.Bounds.Width < (MinX + Me.BoundariesWidth) Then 'Manage cases only if shape width is < to red rectangle width (infinite loop risk)
            If shapeAsRectangle.Left < MinX Then
                If isRectangleRotated Then
                    p_shape.Position = New Point((p_shape.Bounds.X + (MinX - shapeAsRectangle.Left)), p_shape.Bounds.Y)
                Else
                    p_shape.Position = New Point((MinX + 2), p_shape.Bounds.Y)
                End If
 
                isShapePositionModified = True
            End If
 
            If shapeAsRectangle.Right > (MinX + BoundariesWidth) Then
                p_shape.Position = New Point((p_shape.Bounds.X + ((Me.BoundariesWidth + MinX) - shapeAsRectangle.Right)), p_shape.Bounds.Y)
                isShapePositionModified = True
            End If
        Else
            Exit Sub
        End If
 
        'Height management
        If p_shape.Bounds.Height < (MinY + BoundariesHeight) Then 'Manage cases only if shape height is < to red rectangle height (infinite loop risk)
            If shapeAsRectangle.Top < MinY Then
                If isRectangleRotated Then
                    p_shape.Position = New Point(p_shape.Bounds.X, (p_shape.Bounds.Y + (MinY - shapeAsRectangle.Top)))
                Else
                    p_shape.Position = New Point(p_shape.Bounds.X, (MinY + 2))
                End If
 
                isShapePositionModified = True
            End If
 
            If shapeAsRectangle.Bottom > (MinY + BoundariesHeight) Then
                If isRectangleRotated Then
                    p_shape.Position = New Point(p_shape.Bounds.X, (p_shape.Bounds.Top - (shapeAsRectangle.Bottom - BoundariesHeight) + MinY))
                Else
                    p_shape.Position = New Point(p_shape.Bounds.X, (p_shape.Bounds.Y - (p_shape.Bounds.Bottom - (MinY + BoundariesHeight)) - 2))
                End If
 
                isShapePositionModified = True
            End If
        Else
            Exit Sub
        End If
 
        If isShapePositionModified Then
            Me._moveShapeCount += 1
            Me.MoveShape(p_shape)
        End If
    Catch ex As Exception
        If Debugger.IsAttached Then Debugger.Break()
        MAATrace.Log("MoveShape EXCEPTION", "Error in MoveShape() (top-left position : '" + p_shape.Position.ToString() + "') : " + ex.Message)
    End Try
End Sub

 

For example, consider the first case => If shapeAsRectangle.Left < MinX

For all shapes, the p_shape.Position is set to 22, but for RadDiagramConnection, the value is not updated.

 

Do you know why the position is not updated for RadDiagramConnection ? And how can I resolve it ?

Furthermore, I should to be able to know if there is a rotation for the shape which encircle the RadDiagramConnection (the If, elseif, elseif... is a draft copy)

 

Thanks a lot.

Valentin
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 19 Apr 2018
1 answer
187 views

I'm not able to get Dragon select drop-down options.

 <telerik:RadComboBox Grid.Row="5" Grid.Column="1" Padding="1" Grid.ColumnSpan="3" Name="SearchComboBox"                               
                                AutomationProperties.Name="Search:"
                                MaxHeight="20"
                                MinWidth="270"
                                VerticalAlignment="Center"
                                IsEditable="True"
                                IsReadOnly="False"
                                CanAutocompleteSelectItems="False"
                                CanKeyboardNavigationSelectItems="False"
                                IsTextSearchEnabled="False"
                                StaysOpenOnEdit="False"
                                OpenDropDownOnFocus="False"
                                IsMouseWheelEnabled="True"
                                MaxDropDownHeight="200"
                                Focusable="True"
                                IsTabStop="True"
                                TabIndex="101"         
                                ItemTemplate="{StaticResource GridLikeDataTemplate}"
                                TextBoxStyle="{StaticResource CustomComboTextBoxStyle}"
                                ItemsSource="{Binding List}"
                                KeyDown="General_KeyDown"
                                ScrollViewer.ScrollChanged="SearchCombo_ScrollChanged"
                                TextBoxBase.TextChanged="SearchCombo_TextChanged"
                                SelectionChanged="SearchCombo_SelectionChanged" >
                                <!--<telerikPresentation:RadComboBox.ItemContainerStyle>
                                    <Style TargetType="{x:Type telerikPresentation:RadComboBoxItem}">
                                        <Setter Property="AutomationProperties.Name" Value="{Binding Name}"/>
                                    </Style>
                                </telerikPresentation:RadComboBox.ItemContainerStyle>-->

                            </telerik:RadComboBox>

Template:

   <DataTemplate x:Key="GridLikeDataTemplate">
                                <DockPanel DataContext="{Binding}">
                                    <TextBlock Width="150" DockPanel.Dock="Right" Foreground="Gray" Text="{Binding TypeName}" Margin="0,0,15,0" />
                                    <TextBlock Text="{Binding Name}" FontWeight="Bold" Margin="0,0,20,0" AutomationProperties.Name="{Binding Name}"/>
                                </DockPanel>
                            </DataTemplate>

 

I used Inspect.exe and verified that the "Name" property was set propertly, but Click <PROPERTY NAME> is not working.  Please let me know if there is anything I missed. Thank you in advance. 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 19 Apr 2018
4 answers
71 views

Does anybody know if the results from sibling aggregate functions can be used as input values for another function?

I would like to display the following grid:

                          Day 1                                 

                          Aggr1     Aggr2    Diff
  Shop               v1            v2         v1-v2
       Item A        p1A         p2A
       Item B        p1B         p2B

 

Is there any way to access the Aggr1 and Aggr 2 results in the Diff aggregate?

Martin Ivanov
Telerik team
 answered on 19 Apr 2018
1 answer
232 views
Here's my code in which I'm binding the command of RadRibbonRadioButton, but it is not working:

<telerik:RadRibbonGroup Header="Display X/Y in" FontSize="13">
                <telerik:RadCollapsiblePanel>
                    <telerik:RadRibbonRadioButton  x:Name="MapCoordinates"
                                                    IsChecked="{Binding MapCoordinatesChecked}"
                                                    CollapseToSmall="WhenGroupIsSmall"
                                                    CollapseToMedium="WhenGroupIsMedium"
                                                    telerik:ScreenTip.Description="Map Coordinates"
                                                    telerik:ScreenTip.Title="Map Coordinates"
                                                    Size="Large"
                                                    Text="Map Coordinates"
                                                    Command="{Binding RibbonControlRadioButtonClickedCommand}"
                                                    CommandParameter="{Binding ElementName=MapCoordinates}"
                                                    SmallImage="Resources\MapCoordinates.png"
                                                    LargeImage="Resources\MapCoordinates.png" />
 </telerik:RadCollapsiblePanel>
</telerik:RadRibbonGroup>

 

Kindly let me know, how can I bind its command in MVVM architecture.

 

Regards,

Tayyaba 

Vladimir Stoyanov
Telerik team
 answered on 19 Apr 2018
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?