Telerik Forums
UI for WPF Forum
1 answer
175 views
Hi,

When I am trying to input a ¬ symbol into a RadRichTextBox element, it does a carriage return + newline instead of writing out the symbol. I have tried both pasting the symbol in as well as pressing the keyboard command.

Do you have any idea what might cause this?

Thanks in advance
Iva Toteva
Telerik team
 answered on 31 Jul 2012
1 answer
73 views
Hi,
I need to create a chart similar to the image attached. My main question is whether this can be done using ChartView and if yes, then how to do this. The main point of the chart is to display a combination of events and individual point. Each point has a timestamp and a value, and an event has a start time and end time. The X axis is time. The Y axis is a type (a string description). The ChartView control is quite extensive, and I used it in the past to display scatter graph, but this problem has me puzzled. Displaying individual point streams is easy, but the event stream part does not seem to fit into anything available to me. Based on my reading it seems as I may have to implement my own series class - if that is the case the example of doing so would be great.

Thanks
Tsvetie
Telerik team
 answered on 31 Jul 2012
1 answer
277 views
I have one TextBox(for searching items in Radgridview) and RadGridview in my WPF window. When we search any items from textbox focus will be on first row. After that when i press mouse up and down buttons focus will move next line. But it did not happen. When i click on mouse on hihglighted row, Then only focusing is changing. Can any one help on this? 

Thanks,
Ram

Dimitrina
Telerik team
 answered on 31 Jul 2012
7 answers
162 views
Hi,

I am using ScatterLineSeries to plot a serie of data points. What I want to achieve is that I could mouse-click on a point and move it up or down. How could I achieve this. Please help. The control I am using is ChartView for WPF in 2012 Q2 package.

Thanks,
Mark
Mark
Top achievements
Rank 1
 answered on 30 Jul 2012
3 answers
136 views
I would like to know how to display the following view model 

public class AssetClassLevelViewModel
{    
     
public string AssetClassName {get; set;}

     
public ObservableCollection<AssetClassLevelViewModel> ChildAssetClasses {get; set;}

     
public ObservableCollection<ProductHoldingsWithAllocationViewModel> ProductHoldings {get; set;}

}
The ProductHoldingsWithAllocationViewModel has properties such as ProductName etc., which are to be displayed in columns. Attached is a sample of what it should look like.

The AssetClass in the picture is in the AssetClassLevelViewModel, and each of the Products is represented by the ProductHoldingsWithAllocationViewModel.

I would like to know if this is possible, if we are to use the RadTreeListView.

Thank You

Pavel Pavlov
Telerik team
 answered on 30 Jul 2012
1 answer
420 views
Hello,

I am using RadControls version 2012.2.607.40 for WPF 4.

I am having an issue with the scrolling of a RadGridView. The problem is that under certain circumstances, the RadGridView scrolls to the top for no apparent reason. The following xaml and code-behind show a simple sample:

<Window x:Class="RadGridViewScrollingSample.MainWindow"
        xmlns:local="clr-namespace:RadGridViewScrollingSample"
        x:Name="_this"
        Title="MainWindow" Height="350">
     
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
    </Window.Resources>
     
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
 
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
            <TextBlock Text='Scroll down in the grid view below then move the mouse over "Place Mouse Here".'/>
            <TextBlock Text="You will see the grid view automatically scroll to the top."/>
            <TextBlock Text='Clicking in "Place Mouse Here" will scroll the last row of the grid view in to view, but'/>
            <TextBlock Text='the grid view will again scroll to the top when the mouse is moved outside "Place Mouse Here".'/>
        </StackPanel>
 
        <telerik:RadGridView x:Name="gridView" Grid.Row="1" Grid.Column="0" ScrollViewer.VerticalScrollBarVisibility="Visible" ItemsSource="{Binding Path=Things}"/>
         
        <TextBlock Grid.Row="1" Grid.Column="1" x:Name="placeholder" HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap" TextAlignment="Center" Text="Place Mouse Here" FontSize="40" MouseUp="OnMouseUp"/>
             
        <DockPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
            <TextBlock Text="This is placeholder text.  "/>
            <TextBlock Text='This text appears when the mouse is over "Place Mouse Here".' Visibility="{Binding ElementName=placeholder, Path=IsMouseOver, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        </DockPanel>
    </Grid>
</Window>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using System.ComponentModel;
 
namespace RadGridViewScrollingSample
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private ObservableCollection<Thing> things = new ObservableCollection<Thing>();
 
        private string[] colors = new string[] { "red", "green", "blue", "orange", "purple" };
        private string[] sizes = new string[] { "small", "medium", "large" };
 
        public MainWindow()
        {
            InitializeComponent();
 
            DataContext = this;
 
            int i = 0;
            for (char c = 'A'; c <= 'Z'; c++, i++)
            {
                things.Add(new Thing(c.ToString(), colors[i % colors.Length], sizes[i % sizes.Length]));
            }
        }
 
        public ObservableCollection<Thing> Things
        {
            get { return things; }
        }
 
        private void OnMouseUp(object sender, MouseButtonEventArgs e)
        {
            gridView.ScrollIntoView(things.FirstOrDefault(t => t.Name == "Z"));
        }
    }
 
    public class Thing
    {
        private string name;
        private string color;
        private string size;
 
        public Thing(string name, string color, string size)
        {
            this.name = name;
            this.color = color;
            this.size = size;
        }
 
        public string Name
        {
            get { return name; }
        }
 
        public string Color
        {
            get { return color; }
        }
 
        public string Size
        {
            get { return size; }
        }
    }
}

If I scroll the RadGridView to the bottom and then move the mouse over the text "Place Mouse Here", the RadGridView scrolls to the top. If I then click the mouse over "Place Mouse Here", causing the RadGridView to scroll to the bottom, and then move the mouse outside the text "Place Mouse Here", the RadGridView again scrolls to the top. Note that placing the mouse over the text "Place Mouse Here" causes a TextBlock to become visible at the bottom of the screen.

I can stop this auto scrolling of the RadGridView by changing either or both the grid row height of * or grid column width of * to a fixed value. However, this is not an acceptable solution because I want those grid row and column to take all remaining space in the window.

I believe, but can't prove, that this behavior has something to do with a SizedChange event being fired when the TextBlock at the bottom of the window changes its visibility. But obviously in my case, no sizes are actually changing.

Can anybody tell me what is causing the unsolicited scrolling of my RadGridView and, better yet, how to avoid this behavior?

Thank you,

-- john
Maya
Telerik team
 answered on 30 Jul 2012
1 answer
231 views
In my ShellV, I have a CustomRegion:

   <telerik:RadDocking HasDocumentHost="True"
                            Grid.Row="3"
                            x:Name="MainRadDocking"
                            BorderThickness="0"
                            Margin="0"                            
                            Background="Transparent">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup  prism:RegionManager.RegionName="MainPaneRegion"
                                           Name="MainDockingPanelGroup"/>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
            <telerik:RadSplitContainer InitialPosition="DockedLeft">
                <telerik:RadPaneGroup prism:RegionManager.RegionName="LeftPaneRegion"
                                      Name="LeftDockingPanelGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="DockedRight">
                <telerik:RadPaneGroup  prism:RegionManager.RegionName="RightPaneRegion"
                                       Name="RightDockingPanelGroup"/>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>

When I launch my application, I am getting 81 errors, here is a sample:

System.Windows.Data Information: 41 : BindingExpression path error: 'PaneHeaderVisibility' property not found for 'object' because data item is null.  This could happen because the data provider has not produced any data yet. BindingExpression:Path=SelectedPane.PaneHeaderVisibility; DataItem='AutoHideArea' (Name='LeftAutoHide'); target element is 'PaneHeader' (Name=''); target property is 'Visibility' (type 'Visibility')

System.Windows.Data Information: 20 : BindingExpression cannot retrieve value due to missing information. BindingExpression:Path=SelectedPane.PaneHeaderVisibility; DataItem='AutoHideArea' (Name='LeftAutoHide'); target element is 'PaneHeader' (Name=''); target property is 'Visibility' (type 'Visibility')

System.Windows.Data Information: 21 : BindingExpression cannot retrieve value from null data item. This could happen when binding is detached or when binding to a Nullable type that has no value. BindingExpression:Path=SelectedPane.PaneHeaderVisibility; DataItem='AutoHideArea' (Name='LeftAutoHide'); target element is 'PaneHeader' (Name=''); target property is 'Visibility' (type 'Visibility')

System.Windows.Data Information: 10 : Cannot retrieve value using the binding and no valid fallback value exists; using default instead. BindingExpression:Path=SelectedPane.PaneHeaderVisibility; DataItem='AutoHideArea' (Name='LeftAutoHide'); target element is 'PaneHeader' (Name=''); target property is 'Visibility' (type 'Visibility')

System.Windows.Data Information: 41 : BindingExpression path error: 'IsActive' property not found for 'object' because data item is null.  This could happen because the data provider has not produced any data yet. BindingExpression:Path=SelectedPane.IsActive; DataItem='AutoHideArea' (Name='LeftAutoHide'); target element is 'PaneHeader' (Name='HeaderElement'); target property is 'IsHighlighted' (type 'Boolean')

What is causing this problem? Do I need to set the bindings to a fallbackvalue? Do I need to create RadPanes within the RadPaneGroups? If so, can you send me an example?

Georgi
Telerik team
 answered on 30 Jul 2012
1 answer
115 views
Hello,

Is there any possible way to get the list of options to a word through code-behind?

Something like the famous "you mean?" Google?

thanks
Andrew
Telerik team
 answered on 30 Jul 2012
3 answers
154 views
Hello

Please refer to the telerik "Save/Load the Content of the Panes" docking topic. I'm trying to load the layout of my docking control in this way when navigating away and then returning to this screen to maintain view state. This page refers to the following piece of code:
private void radDocking_ElementLoading( object sender, Telerik.Windows.Controls.LayoutSerializationLoadingEventArgs e )
{
    var pane = e.AffectedElement as RadPane;
    if ( pane != null )
    {
        pane.Content = this.GetPaneContent( e.AffectedElementSerializationTag );
    }
}

I assume that "GetPaneContent" refers to some internal method in the code-behind which returns the content, whatever that control may have been before the content was saved. Since I am using MVVM and adding RadPanes and RadPaneGroups dynamically in my view model, I maintain a dictionary of the pane contents by the serialization tag that I assign to each one. This view model code is as follows:

RadPaneGroup radPaneGroup = new RadPaneGroup { VerticalAlignment = VerticalAlignment.Top, VerticalContentAlignment = VerticalAlignment.Top };
            this.view.splitContainer.Items.Add(radPaneGroup);
            RadPane radPane = new RadPane
                                          {
                                              Content = createdChartView,
                                              CanUserClose = true,
                                              Title = createdChartView.DisplayName,
                                          };
            RadDocking.SetSerializationTag(radPane, chartConfiguration.Id.ToString());
            RadDocking.SetSerializationTag(radPaneGroup, chartConfiguration.Id.ToString());
 
            radPaneGroup.Items.Add(radPane);
            this.hostedCharts.Add(chartConfiguration.Id, createdChartView);

To explain, chartConfiguration.Id is a Guid which serves as a string tag and hostedCharts is a field of type Dictionary<Guid, ChartView>.
I use this dictionary to get the ChartView when I reload the layout. ChartView is the content I want to reset as the content of the pane.

My element loading event handler looks like this:

private void RadDockingOnElementLoaded(object sender, LayoutSerializationEventArgs e)
        {
            RadPane newPane = e.AffectedElement as RadPane;
            if (newPane != null)
            {
                ChartView chartView = ((ChartHostViewModel)this.DataContext).GetPaneContent(e.AffectedElementSerializationTag);
 
// This entire section is to try to remove the chart from its parent all the way up the visual tree.
                RadPane oldParentPane = (RadPane)chartView.Parent;
                if (oldParentPane != null)
                {
                    RadPaneGroup oldParentGroup = (RadPaneGroup)oldParentPane.Parent;
                    if (oldParentGroup != null)
                    {
                        RadSplitContainer oldSplitContainer = (RadSplitContainer)oldParentGroup.Parent;
 
                        if (oldSplitContainer != null)
                        {
                            oldSplitContainer.Items.Remove(oldParentGroup);
 
                        }
                        oldParentGroup.Items.Remove(oldParentPane);
                    }
                    oldParentPane.Content = null;
                }
 
                newPane.Content = chartView;
                return;
            }
 
// This section is here because the pane groups fill up the entire space if I leave it out (They seem to be aligned to Stretch)
            RadPaneGroup newPaneGroup = e.AffectedElement as RadPaneGroup;
            if (newPaneGroup != null)
            {
                newPaneGroup.VerticalAlignment = VerticalAlignment.Top;
                newPaneGroup.VerticalContentAlignment = VerticalAlignment.Top;
            }
        }

Here's my concern:
Firstly, if I remove the code to try to remove the ChartView from its parent, I get an InvalidOperationException saying to first disconnect the element before adding it to a new one on the line, "newPane.Content = chartView;" . It seems that the entire visual tree is still intact and reloading the screen creates new visual elements and adds these to the Docking component. Is this not memory intensive? Please note that this screen's (my screen, "ChartHostView")'s lifestyle is Transient and may be affecting the way it should work.

Secondly, my pane groups are not being loaded in the state that I saved them in. Why is it necessary for me re-set their Vertical Alignment ?

Please let me know if I am going about this the completely wrong way.
Thank you.
Miroslav Nedyalkov
Telerik team
 answered on 30 Jul 2012
1 answer
68 views
Hi

Can someone help me with the following please

How do I set the foreground color in GridViewCheckBoxColumn in XAML ?

I can't seem to find the appropriate property to set

thanks

Murray
Dimitrina
Telerik team
 answered on 30 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?