Telerik Forums
UI for WPF Forum
3 answers
105 views
Hi!

I'm adding from the code an object to one of my recursive ObservableCollection. There is a root ObservableCollection that is set as ItemsSource. 

When I add it to my collection, I want to select it on my tree.

So how can do this? I cannot find any methods that permits me to get a RadTreeViewItem of my added object.

I've seen that: http://www.telerik.com/help/wpf/radtreeview-how-to-get-item-by-path.html but I'm not sure there will never two element with the same displayed name
Milan
Telerik team
 answered on 26 Aug 2010
6 answers
603 views
Hello!
Is there a way to iterate over a RadDocking control  and check which RadPanes are floating, ans eventually make them docked also from code?

Thank you!
Roxana
RoxanaC
Top achievements
Rank 1
 answered on 26 Aug 2010
1 answer
134 views
Hi there,

I have an RadPane and inside a RadTreeView. When I now change the width of the pane (by runtime) the width of the RadTreeView does not change. Equally when I undock the pane.
What did I have to do that the RadTreeView always has the width of the RadPane?

Thx
Andi
Andi
Top achievements
Rank 2
 answered on 26 Aug 2010
1 answer
326 views
Hi All,
I have a radbutton where i have an image and a text block as its content. The image and text appears in design, but in runtime 
only text gets displayed the image doesn't appear can anyone please get e around this issue.

TIA,

Regards
Sampath
Miroslav
Telerik team
 answered on 26 Aug 2010
5 answers
132 views
I have a tile view something like what is below. How to I set the colors of the tiles in this scenario?

<telerik:RadTileView Margin="12" Name="DashboardRadTileView" ItemsSource="{Binding}" Grid.Row="2" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource PanelGradientBrush}" Foreground="Black" MinimizedItemsPosition="Bottom" Padding="12">
    <telerik:RadTileView.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Path=Description}" />
        </DataTemplate>
    </telerik:RadTileView.ItemTemplate>
    <telerik:RadTileView.ContentTemplate>
        <DataTemplate>
            <StackPanel>
                <TextBlock Text="{Binding Path=Text}"/>
            </StackPanel>
        </DataTemplate>
    </telerik:RadTileView.ContentTemplate>
</telerik:RadTileView>
Kiril Stanoev
Telerik team
 answered on 26 Aug 2010
3 answers
194 views
Hi there,

I want to add images to my TreeViewItems, but it does not work :(
I knew there are many Threads for this theme and I read many of them, but I found no answer which can help me.
I have just a simple .xaml with the Tree and 3 Items and a folder named "Icons" in the source-folder of my project.
What am I doing wrong?

<Window x:Class="TreeViewTest.MainWindow"
        Title="MainWindow" Height="350" Width="525" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Icon="/TreeViewTest;component/ics.ico">
    <Grid>
        <telerik:RadTreeView  HorizontalAlignment="Left"  Name="treeView1" VerticalAlignment="Top" IsLineEnabled="True" FontFamily="Arial" FontSize="10" ImagesBaseDir="/Icons/" IsDragPreviewEnabled="False">
            <telerik:RadTreeViewItem Header="Global" DefaultImageSrc="Folder_16x16-32.png">
                <telerik:RadTreeViewItem Header="Local 1" />
                <telerik:RadTreeViewItem Header="Local 2" />
            </telerik:RadTreeViewItem>
        </telerik:RadTreeView>       
    </Grid>
</Window>
Tina Stancheva
Telerik team
 answered on 26 Aug 2010
10 answers
508 views
Is it possible to disable the horizontal scrollbar? If yes how do I do this?
(RadPanelBar is bound to a HierarchicalDataTemplate).

Peter Chapman
Top achievements
Rank 1
 answered on 26 Aug 2010
2 answers
87 views
Hi!

I've a  Tree, that has a RadContextMenu(Telerik's version of Context Menu). On every ItemMenu, I've an action.

I need to know, on which element of my Tree i've right clicked. How can I do this?

I tried to use the "SelectItem", but it seems the tree doesn't select on right click.

Thank you!

<Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <Grid.Resources>
<HierarchicalDataTemplate x:Key="NodeTemplate" ItemsSource="{Binding SubNodes}">
                                <StackPanel  Orientation="Horizontal">
                                        <TextBlock Text="{Binding Name}"/>
                                </StackPanel>                               
                            </HierarchicalDataTemplate>
                        </Grid.Resources>
<telerik:RadTreeView Name="uxRadTreeView" ItemsSource="{Binding RootFolder.SubNodes}" ItemTemplate="{StaticResource NodeTemplate}" AllowDrop="False" IsDragDropEnabled="True" DragEnded="uxRadTreeView_DragEnded" MouseRightButtonUp="uxRadTreeView_MouseRightButtonUp">
                            <telerik:RadContextMenu.ContextMenu>
                                <telerik:RadContextMenu IsEnabled="{Binding MainTree.CurrentItem.IsFolder, Mode=OneWay}"  >
                                    <telerik:RadMenuItem Header="Create new folder" Icon="/GuiResources;component/ActionsIcons/newFolder.png" Click="NewFolder" />
                                    <telerik:RadMenuItem Header="Create new file"  Icon="/GuiResources;component/ActionsIcons/newFile.png" Click="NewFile"/>
                                    <telerik:RadMenuItem Header="Add a new version of this file" Icon="/GuiResources;component/ActionsIcons/newFileVersion.png" Click="NewFileVersion"/>
                                    <telerik:RadMenuItem Header="Delete" Icon="/GuiResources;component/ActionsIcons/delete.png" Click="Delete"/>
                                </telerik:RadContextMenu>
                            </telerik:RadContextMenu.ContextMenu>
                        </telerik:RadTreeView>
                    </Grid>
Julien
Top achievements
Rank 1
 answered on 26 Aug 2010
1 answer
145 views
Hi All,

I am using the RadChart for WPF in my project for displaying the Chart as LineSeries, my requirment is like this:
 1) I need to add dataPoints dynamically by reading the output file for each Dataseries
  2) I need to add AdditionalYAxes for each Dataseries
  3) I need to Apply ForeGround color for each DataSeries
   4)And the same DataSeires color i need to apply color for related AdditionalYAxes
 
I have done upto the Above Three Steps and i am able to add AdditionalYAxes. But i am not able to Apply the color Style for the AdditionYAxes line and also the AdditionalYAxes is not start from X-axes, for now it is starting from X-axes one Step above.

I need to apply the color for AdditionaYAxes for the relating DataSeries and The Line should Start from X-Axes position.

i have attached my codeSnippet below:
.XAML file

<

 

 

UserControl x:Class="TabControl.MainWindow"

 

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

 

xmlns:telerikChart="http://schemas.telerik.com/2008/xaml/presentation"

 

 

 

xmlns:telerikCharting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"

 

 

 

Height="Auto" Width="Auto">

 

 

 

 

<Grid>

 

 

 

 

<Grid.Resources>

 

 

 

 

<Style x:Name="CustomAxisLineStyle" TargetType="Line">

 

 

 

 

<Setter Property="Stroke" Value="Red" />

 

 

 

 

<Setter Property="StrokeThickness" Value="5" />

 

 

 

 

</Style>

 

 

 

 

</Grid.Resources>

 

 

 

 

<telerikChart:RadChart x:Name="_myChart">

 

 

 

 

</telerikChart:RadChart>

 

 

 

 

</Grid>

 

</

 

 

UserControl>

 


.Xaml.cs file

 

 

private void GenerateSeries(string target, ref DateTime timeStamp, double avgVal, string counterName)

 

{

 

 

int _minsOffSet=0;

 

 

 

DateTime minDate = DateTime.MaxValue;

 

 

 

DateTime maxDate = DateTime.MinValue;

 

 

 

double minVal = double.MaxValue;

 

 

 

double maxVal = double.MinValue;

 

 

 

DataSeries counterSeries = new DataSeries();

 

counterSeries.Definition =

 

new LineSeriesDefinition() { ShowItemLabels = false, ShowItemToolTips = true };

 

counterSeries.Definition.ItemToolTipFormat =

 

"#SERIESLABEL\n#Y";

 

counterSeries.Definition.AxisName = counterName;

 

 

AxisY yAxis = new AxisY();

 

yAxis.AxisName = counterName;

 

 

string legendName = string.Format("{0}", counterName);

 

SetLegendDetails(legendName,

 

ref counterSeries, ref yAxis);

 

 

 

DateTime time = timeStamp.AddMinutes(_minsOffSet);

 

 

minVal =

 

Math.Min(minVal, avgVal);

 

maxVal =

 

Math.Max(maxVal, avgVal);

 

 

 

DataPoint dp = new DataPoint(time.ToOADate(), avgVal);

 

dp.IsDateTime =

 

true;

 

counterSeries.Add(dp);

 

 

if (time > maxDate)

 

maxDate = time;

 

 

if (time < minDate)

 

minDate = time;

 

 

if (avgVal > maxVal)

 

maxVal = avgVal;

 

 

if (avgVal > minVal)

 

minVal = avgVal;

_myChart.DefaultView.ChartArea.AxisX.MinValue = minDate.ToOADate();

_myChart.DefaultView.ChartArea.AxisX.MaxValue = maxDate.ToOADate();

_myChart.DefaultView.ChartArea.AxisY.MinValue = minVal;

_myChart.DefaultView.ChartArea.AxisY.MaxValue = maxVal;

_myChart.DefaultView.ChartArea.DataSeries.Add(counterSeries);

_myChart.DefaultView.ChartArea.AdditionalYAxes.Add(yAxis);

 

 

double graphVariation = maxVal - minVal;

 

 

 

if ((graphVariation > 2) & (graphVariation <= 9))

 

{

_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =

 

"n1";

 

}

 

 

else if (graphVariation <= 2)

 

{

_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =

 

"n3";

 

}

 

 

else

 

{

_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =

 

"n0";

 

_myChart.DefaultView.ChartArea.AxisY.DefaultLabelFormat =

 

"0";

 

}

}

 

 

private void SetLegendDetails(string legendName, ref DataSeries dataSeries, ref AxisY yAxis)

 

{

_myChart.DefaultView.ChartLegend.Header =

 

"";

 

_myChart.DefaultView.ChartLegend.UseAutoGeneratedItems =

 

true;

 

dataSeries.LegendLabel = legendName;

dataSeries.Definition.Appearance.Foreground =

 

new SolidColorBrush(Colors.Green);

 

 

 

Style customAxisYStyle = this.Resources["CustomAxisYStyle"] as Style;

 

_myChart.DefaultView.ChartArea.AxisY.AxisStyles.AxisLineStyle = customAxisYStyle;

 

}

I have attaching the Chart ScreenShot what i implemented.
Please see in Attachments
i am  calling the GenerateSeries Method every time for loading the X-Axis value and Y-Axes value.
Please any one help me how to apply color and starting position of AdditionaYAxes.
This is very urgent Requirment.

Thanks and Regards
Satish
Sia
Telerik team
 answered on 26 Aug 2010
6 answers
159 views
Hi,

On my RadChart i would like to "control" x labelstep thank to a property in a ViewModel (as you see I'm using MVVM pattern).

But when i try to use this mehod, i've got this message :

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Intervalle; DataItem=null; target element is 'AxisX' (HashCode=6253391); target property is 'LabelStep' (type 'Int32')

It seems that RadChart is loosing DataContext juste for this property. Any idea ? :D I probably should affect DataContext to "AxisX" but i don't know how to do it.

Here is my code :

<telerik:ChartArea LegendName="CustomLegend" Name="chArea" NoDataString="Aucune données" DataContext="{Binding ElementName=brd1,Path=DataContext}">
                              <telerik:ChartArea.AxisX>
                                  <telerik:AxisX MajorGridLinesVisibility="Collapsed"
                                                 Title="Heures"
                                                 IsZeroBased="True" AutoRange="True" LabelStep="{Binding Intervalle}" />
                              </telerik:ChartArea.AxisX>
                              <telerik:ChartArea.AxisY>
                                  <telerik:AxisY MajorGridLinesVisibility="Visible"
                                                 MinorTicksVisibility="Visible"
                                                 Title="Hits Lus" AutoScale="True" />
                              </telerik:ChartArea.AxisY>
                          </telerik:ChartArea>


Thank's !
Yves
Top achievements
Rank 1
 answered on 26 Aug 2010
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
ProgressBar
Sparkline
LayoutControl
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
Rating
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?