Telerik Forums
UI for WPF Forum
3 answers
140 views

hi dear developers,

i am using raddiagram in wpf.

for shapes, i have used custom shapes and a text where both image and text are added to a stackpanel and the stackpabnel is setted to be the shape content.

now i need to find the item in the diagram by hit test but the hit test brings the textblock or image instead of raddiagram shape. i need the hit test to bring back the raddiagram shape not image or text block. (i also have used IsHittestvisible property to prevent image and text block from catching by the hit test but by using this, the hit test bring nothing).

al
Top achievements
Rank 1
 answered on 22 Aug 2016
5 answers
132 views

Hi,

I have an issue of when I click on a connector with text block content, the diagram control either selects the incorrect connector or does not select anything at all.  It appears a bit random but is quite repeatable.

I have attached a video of the first scenario: https://www.dropbox.com/s/i7wwxon7iqy6hr1/Telerik%20Diagram%20selection%20issue.mp4?dl=0

(Download video as the video may lose video quality)

In this video the middle connector is already selected.  I then click the connector on the far left and you will see the connector on the far right is selected instead.

Here is the sample code:

<Window x:Class="TelerikWpfApp1.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="800" Width="800">
    <Grid>
        <telerik:RadDiagram>
            <telerik:RadDiagramConnection
                StartPoint="100,100"
                EndPoint="100, 500"
                ConnectionType="Polyline"
                SourceConnectorPosition="Auto"
                StrokeThickness="2"  
                ToolTipService.IsEnabled="True"
                SourceCapType="Arrow1"
                TargetCapType="Arrow2"
                ZIndex="4">
                <telerik:RadDiagramConnection.Content>
                    <TextBlock Text="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"     
                               Background="Yellow"
                           FontFamily="Arial"
                           FontSize="10"
                           Visibility="Visible"
                           FontWeight="Normal"                          
                           RenderTransformOrigin="0.5, 0.5"
                           Padding="0, 15, 0, 0">
                        <TextBlock.RenderTransform>
                            <RotateTransform Angle="90"/>
                        </TextBlock.RenderTransform>
                    </TextBlock>
                </telerik:RadDiagramConnection.Content>
            </telerik:RadDiagramConnection>
            <telerik:RadDiagramConnection
                StartPoint="140,100"
                EndPoint="140, 500"
                ConnectionType="Polyline"
                SourceConnectorPosition="Auto"
                StrokeThickness="2"  
                ToolTipService.IsEnabled="True"
                SourceCapType="Arrow1"
                TargetCapType="Arrow2"
                ZIndex="4">
                <telerik:RadDiagramConnection.Content>
                    <TextBlock Text="BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"                          
                           Background="Yellow"
                               FontFamily="Arial"
                           FontSize="10"
                           Visibility="Visible"
                           FontWeight="Normal"                          
                           RenderTransformOrigin="0.5, 0.5"
                           Padding="0, 15, 0, 0">
                        <TextBlock.RenderTransform>
                            <RotateTransform Angle="90"/>
                        </TextBlock.RenderTransform>
                    </TextBlock>
                </telerik:RadDiagramConnection.Content>
            </telerik:RadDiagramConnection>
            <telerik:RadDiagramConnection
                StartPoint="180,100"
                EndPoint="180, 500"
                ConnectionType="Polyline"
                SourceConnectorPosition="Auto"
                StrokeThickness="2"  
                ToolTipService.IsEnabled="True"
                SourceCapType="Arrow1"
                TargetCapType="Arrow2"
                ZIndex="4">
                <telerik:RadDiagramConnection.Content>
                    <TextBlock Text="CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"                          
                           Background="Yellow"
                               FontFamily="Arial"
                           FontSize="10"
                           Visibility="Visible"
                           FontWeight="Normal"                          
                           RenderTransformOrigin="0.5, 0.5"
                           Padding="0, 15, 0, 0">
                        <TextBlock.RenderTransform>
                            <RotateTransform Angle="90"/>
                        </TextBlock.RenderTransform>
                    </TextBlock>
                </telerik:RadDiagramConnection.Content>
            </telerik:RadDiagramConnection>
        </telerik:RadDiagram>
    </Grid>
</Window>

 

Is there a workaround for this?

 

 


Chris
Top achievements
Rank 1
 answered on 22 Aug 2016
2 answers
1.3K+ views

Hello, I am trying to restrict a floating window to be resized manually. In addition, I want a user control to fill out the space it needs and have the floating window adjust to its content. Is this possible?

My XAML:

   <telerik:RadDocking x:Name="radDocking" Height="1" Width="1">                 <telerik:RadSplitContainer InitialPosition="FloatingOnly" telerik:RadDocking.FloatingLocation="100,400"                                                                                telerik:RadDocking.FloatingSize="800,500">                     <telerik:RadPaneGroup>                         <telerik:RadPane x:Name="ScheduleControlPane" CanUserPin="False"  Header="Kontroll" Loaded="ScheduleControlPane_Loaded"                                                          IsHidden="{Binding Path=IsChecked, ElementName=ScheduleControlToggleButton, Converter={StaticResource invertedBooleanConverter}, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">                             <controlviews:ControlView HorizontalAlignment="Stretch" VerticalAlignment="Stretch" DataContext="{Binding ControlViewModel}"></controlviews:ControlView>                         </telerik:RadPane>                     </telerik:RadPaneGroup>                 </telerik:RadSplitContainer>             </telerik:RadDocking>

Tore
Top achievements
Rank 1
 answered on 22 Aug 2016
5 answers
606 views
Hi,

I am trying to create a hierarchical grid with both parent and child have the extra same number of columns. I would like to align the columns of the child grid with the parent grid when expanded. Is there a way to customize?

Thanks
Stefan
Telerik team
 answered on 22 Aug 2016
2 answers
197 views

Hello,

 

In my RadCartesianChart, i'm using the StepLineSeries class for my series.

In my software, I purpose to change the stroke type : Full Line, Dotted Line and Hyphen Line.

 

The serie style can be applicated in just one style :

I want to know if is it possible to have a serie (CustomStepLineSerie ??) with 2 or 3 style in an other same time ? I don't want to create other serie to fixe over it.

 

I attached differents files to illustrate my request.

 

Thank you !

Valentin
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 22 Aug 2016
5 answers
390 views
Hi,
Can you provide example where it has multiple lineseries with maximum of two vertical axes, sharing X axis.
And having the ability to dynamically switch axes for line series. 
For example Three lineSeries A,B and C.
All A,B,C have veritcal axes default location set as Left.
I have button on my UI that lets user change axes location --from Left and Right. and Right to Left for each series.

Could not find any sample in Teleriks forum that does something similar. I tried to do this, but I seem to change the axes one time, second time it does not work. 
I created two axis one default 

<

 

 

telerik1:RadCartesianChart.VerticalAxis>

 

 

 

 

<telerik1:LinearAxis Name="LeftAxis" ElementBrush="DarkGreen"/>

 

 

 

 

</telerik1:RadCartesianChart.VerticalAxis>
and one additional axis as in sample

 

 

<

 

 

telerik1:RadCartesianChart.Resources>

 

 

 

 

<telerik1:LinearAxis HorizontalLocation="Right" Name="RightAxis" x:Key="additionalVerticalAxis" ElementBrush="Blue" FontWeight="Bold" />

 

 

 

 

</telerik1:RadCartesianChart.Resources>

 


In the code behind I try to switch a linerseries vertical axis back and forth using

 

 

if(yAxisType == YAxisType.Left){ //User picked left

 

lineSeries.VerticalAxis.Name =

 

string.Empty; //To pick the default one?

 

}

 

 

if(yAxisType == YAxisType.Right){//User picked right

 

lineSeries.VerticalAxis = View.TryFindResource("additionalVerticalAxis");

 

// _rightLinearAxis;

 

}


Problem seems to be that Line series A has range of 0-3, B has range of 90-100, if both are on vertical axis and Left Y Axis is ranging from 0-100. If I make B to right axis then Left axis is still from 0-100 instead of 0-3.
Same situation with Y axis also.

Any sample of dynamically swtiching Y axes would be perfect.

Thanks,
Martin Ivanov
Telerik team
 answered on 22 Aug 2016
2 answers
133 views

I was Wondering if there was a way to Activate rectangle selection on map without holding Shift key. like by pressing a toggle button and then click-moving the mouse on the map.

the actual scenario is using rectangle selection on a touch screen with no keyboard

Sayyed Hossein
Top achievements
Rank 1
 answered on 22 Aug 2016
1 answer
360 views

How can I make this work with the property grid?  I am using a property grid with automatically generated properties and on edit I want SelectedIndex1 and SelectedIndex2 to display a list of my available indexes for the user to choose from.

public class MyIndexSelector
{
    private readonly List<int> m_someList = new List<int> () {1, 2, 3};
    [Browsable (false)]
    public List<int> AvailableIndexes { get { return m_someList; } }
 
    //??[Telerik.Windows.Controls.Data.PropertyGrid.Editor (typeof (IndexEditorControl), Telerik.Windows.Controls.Data.PropertyGrid.EditorStyle.DropDown)]
    public int SelectedIndex1 { get; set; }
 
    //??[Telerik.Windows.Controls.Data.PropertyGrid.Editor (typeof (IndexEditorControl), Telerik.Windows.Controls.Data.PropertyGrid.EditorStyle.DropDown)]
    public int SelectedIndex2 { get; set; }
}

 

Dilyan Traykov
Telerik team
 answered on 19 Aug 2016
1 answer
131 views

first time set the ItemsSource then select one,the selecteditems's count is 1,

when reset the tilelist's ItemsSource,select one, the selecteditems count is 2,

        <telerik:RadTileList HorizontalAlignment="Left" ItemsSource="{Binding FpFieldDisplays,Mode=TwoWay}" SelectionMode="Multiple" VerticalAlignment="Top" SelectionChanged="RadTileList_SelectionChanged"/>
        <Button x:Name="button" Content="load" HorizontalAlignment="Left" Margin="385,271,0,0" VerticalAlignment="Top" Width="75" Click="button_Click"/>
        <Button x:Name="button_Copy" Content="count" HorizontalAlignment="Left" Margin="385,171,0,0" VerticalAlignment="Top" Width="75" Click="button1_Click"/>

 

backend

    /// </summary>
    public partial class MainWindow : Window
    {
        private vm vv = new vm();
        public MainWindow()
        {

            InitializeComponent();
            this.DataContext = vv;

        }


        private int cunt = 0;
        private void RadTileList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var tile = sender as Telerik.Windows.Controls.RadTileList;
            cunt = tile.SelectedItems.Count;
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            vv.FpFieldDisplays = new ObservableCollection<itm>()
            {
                new itm() {Name ="21",value = "1" },
                new itm() {Name ="22",value = "2" },
                new itm() {Name ="21",value = "1" },
                new itm() {Name ="22",value = "2" },
                new itm() {Name ="21",value = "1" },
                new itm() {Name ="22",value = "2" },
                new itm() {Name ="21",value = "1" },
                new itm() {Name ="22",value = "2" },
                new itm() {Name ="23",value = "3" }
            };

        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show(cunt.ToString());
        }
    }
    public class vm : BindableBase
    {
        public vm()
        {
            FpFieldDisplays = new ObservableCollection<itm>()
            {
                new itm() {Name ="1",value = "1" },
                new itm() {Name ="2",value = "2" },
                new itm() {Name ="3",value = "3" }
            };

        }
        private ObservableCollection<itm> mFpFieldDisplays;
        public ObservableCollection<itm> FpFieldDisplays
        {
            get { return this.mFpFieldDisplays; }
            set { this.SetProperty(ref this.mFpFieldDisplays, value); }
        }

    }

    public class itm
    {
        public string Name { get; set; }
        public string value { get; set; }
    }

 

 

 

Dilyan Traykov
Telerik team
 answered on 19 Aug 2016
1 answer
149 views

Hello,

I am using RadTreeView and it's bind to an object (basically like in RadTreeView - Binding to object) with IsDragDropEnabled set to True. I use the following piece of code in XAML to define a structure

<Window.Resources>
    <sampleData:RadTreeViewSampleData x:Key="DataSource"/>
    <DataTemplate x:Key="Team">
        <TextBlock Text="{Binding Name}" />
    </DataTemplate>   
    <HierarchicalDataTemplate x:Key="Division" ItemTemplate="{StaticResource Team}"
           ItemsSource="{Binding Teams}">
        <TextBlock Text="{Binding Name}" />
    </HierarchicalDataTemplate>
    <HierarchicalDataTemplate x:Key="League" ItemTemplate="{StaticResource Division}"
           ItemsSource="{Binding Divisions}">
        <TextBlock Text="{Binding Name}" />
    </HierarchicalDataTemplate>
</Window.Resources>

 

I need to support

  1. reordering groups (reordering divisions),
  2. items in group (swapping Team I and Team II)  and
  3. moving the items from one group to another (moving Team II to Division B).

That is built-in and it works. I face other problems: 

  1. control allows nesting groups - if user drags Division B and puts it on Division A, Division B disappears. 
  2. the similar problem happens also with the lowest level (teams) 

 

Hopefully the description is clear enough. Thanks for your time and help.

 

Regards,

Tomas

Martin Ivanov
Telerik team
 answered on 19 Aug 2016
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?