Telerik Forums
UI for WPF Forum
1 answer
113 views
Dear telerik,
I am using radrichtext box. I am trying to set fontsize, font-family through style but it is not working.
<my:RadRichTextBox x:Name="txtChat">
    <my:RadRichTextBox.Resources>
        <Style TargetType="my:RadRichTextBox">
            <Setter Property="FontSize" Value="32"></Setter>
            <Setter Property="Height" Value="100"></Setter>
        </Style>
    </my:RadRichTextBox.Resources>
</my:RadRichTextBox>

Would you please tell me how can I set fontsize and font-family using style.

Regards
Animesh



Animesh Dey
Top achievements
Rank 2
 answered on 27 Oct 2011
4 answers
146 views
Hi,

I expect the SelectionEnd and SelectionStart values to stay within the bounds of the Maximum and Minimum but they don't.  I created a small sample app that demonstrates this behavior.

View:
<Grid>
    <StackPanel>        
        <StackPanel Orientation="Horizontal" Height="50">
            <Label Content="Upper Thumb" />
            <TextBox Width="300" Height="35" Text="{Binding Path=SelectionEnd}" />
        </StackPanel>
        <telerik:RadSlider Name="radSlider"
                           VerticalAlignment="top"
                           Width="25"
                           Height="200"
                           Margin="0 10 5 0"
                           IsSelectionRangeEnabled="True"
                           TickPlacement="None"
                           Minimum="0.0"
                           Maximum="1.0"
                           Orientation="Vertical"
                           SelectionStart="{Binding Path=SelectionStart, Mode=TwoWay, FallbackValue=0.25}"
                           SelectionEnd="{Binding Path=SelectionEnd, Mode=TwoWay, FallbackValue=0.5}"
                           LargeChange="0.05"
                           SmallChange="0.05" />
        <StackPanel Orientation="Horizontal" Height="50">
            <Label Content="Lower Thumb" />
            <TextBox Width="300"  Height="35" Text="{Binding Path=SelectionStart}" />
        </StackPanel>
    </StackPanel>
</Grid>

Code behind:
public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
        var vm = new SliderViewModel();
        DataContext = vm;
    }
}

ViewModel:
public class SliderViewModel : INotifyPropertyChanged
{
    public SliderViewModel()
    {
        _selectionStart = 0.25;
        _selectionEnd = 0.5;
    }
    private double _selectionStart;
    public double SelectionStart
    {
        get
        {
            return _selectionStart;
        }
        set
        {
            if (_selectionStart != value)
            {
                _selectionStart = value;
                OnPropertyChanged("SelectionStart");
            }
        }
    }
    private double _selectionEnd;
    public double SelectionEnd
    {
        get
        {
            return _selectionEnd;
        }
        set
        {
            if (_selectionEnd != value)
            {
                _selectionEnd = value;
                OnPropertyChanged("SelectionEnd");
            }
        }
    }
    public event PropertyChangedEventHandler PropertyChanged;
    protected virtual void OnPropertyChanged(String propertyName)
    {
        var handler = PropertyChanged;
        if (handler != null)
        {
            handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

Am I missing a property on the slider that will prevent this behavior or do I have to catch it manually?

Thanks,
Josh
Petar Mladenov
Telerik team
 answered on 27 Oct 2011
1 answer
148 views
Hello

I seem to have found an issue with the ScrollIntoView method of the RadGridView. If we take a well populated grid so that it is necessary to scroll to reach the bottom, with the entries grouped in various groups.
When modifying an item at the bottom of the grid, when the grid refreshes, it scrolls to a point above the selected item, the height above where it should be seems to coincide exactly with the combined height of each of the grouping rows.

Thanks
Nedyalko Nikolov
Telerik team
 answered on 27 Oct 2011
3 answers
732 views
Hi Telerik,

I am working with richtextbox. I am facing problem when I add text from code behind.
1. The richtextbox showing no text.
2. When I try to select text "Object reference not set" occur some time. Other time, after selecting the text become visible.
3. An additional enter is showing at the top of the richtextbox.

<Window x:Class="Imagine.TelerickTest.RichTextBox.WithoutMVVM"
        xmlns:my="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Documents"
        xmlns:radDoc ="clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents"
        Title="WithoutMVVM" Height="500" Width="500">
    <DockPanel>
        <StackPanel DockPanel.Dock="Top">
            <TextBlock Text="Input"></TextBlock>
            <TextBox x:Name="txtInput" ></TextBox>
        </StackPanel>
        <Button x:Name="btnClick" Content="Click" Click="btnClick_Click" DockPanel.Dock="Top"></Button>
        <my:RadRichTextBox x:Name="txtMessage" LayoutMode="Flow"></my:RadRichTextBox>
    </DockPanel>
</Window>

public WithoutMVVM()
        {
            InitializeComponent();
        }
        private void btnClick_Click(object sender, RoutedEventArgs e)
        {
            var span = new Telerik.Windows.Documents.Model.Span(txtInput.Text);
            var p = new Telerik.Windows.Documents.Model.Paragraph();
            p.Inlines.Add(span);
 
            var section = new Telerik.Windows.Documents.Model.Section();
            section.Blocks.Add(p);
 
            txtMessage.Document.Sections.Add(section);
        }

Regards

Animesh 
Mihail
Telerik team
 answered on 27 Oct 2011
7 answers
290 views
I have setup in my code a RoutedCommand for escape key:

  public static RoutedCommand CloseFormCommand = new RoutedCommand();
  CloseFormCommand.InputGestures.Add(new KeyGesture(Key.Escape));

This works fine when the keyboard focus is on a control like a textbox in the form. But as soon as I click on the Grid and it is set to Edit mode pressing the Escape key will just finish the edit mode and it won't call the command unless I set the cursor back to the textbox by mouse and press the Escape key. How can I fix this problem?
Maya
Telerik team
 answered on 27 Oct 2011
4 answers
147 views
I am using the grid as a read only display of data.

I would like to hide the selection row (highlighted row) in the grid.

I tried CanSelect = false but the grid still displays a highlighted row...

Thanks,

Michel
Michel
Top achievements
Rank 1
 answered on 26 Oct 2011
1 answer
259 views
Hello!
I have a very poor performance when EnableRowVirtualization="True" and no rowHeight is set.
If I set e.g. Row.Height = 90 then everything is okay.

Any Ideas?
Andrew
Top achievements
Rank 1
 answered on 26 Oct 2011
10 answers
326 views
Thank you for the new RadRichTextBox.
I installed the new Q1 for 2011 and tried the Telerik Editor example.
Works fine, but... when I try to open or save documents as .docx (or as richtextformat) I get a messagebox: "Unsupported File format".

Office 2010 (Norwegian) is installed.
Boby
Telerik team
 answered on 26 Oct 2011
6 answers
155 views
Hi,

in my RadOutLookBar, I have mutltiple group section, for each section, I have multiple buttons. When the user click on an header group item, I show a graphical representation of his stats, if the user click on a button attach to the group, I display a grid. If the user want his graphic back, he cannot just click on the group header item again because the selection_changed event wasn't fired.

What is the best approach the handle this?

Thank's
Oliver
Top achievements
Rank 1
 answered on 26 Oct 2011
2 answers
220 views
I just have put a RadBusyIndicator in my Window like this:

 <telerik:RadBusyIndicator IsBusy="{Binding IsWorking}" BusyContent="Loading..." />

And in my App object I do (OnStartup event):
    StyleManager.ApplicationTheme = new MetroTheme();
            var findResource = FindResource("BaseColor");
            if (findResource != null)
                MetroColors.PaletteInstance.AccentColor = (Color)findResource;
When I run my application. So I get this error:

System.Windows.Markup.XamlParseException occurred
  Message=Set property 'Telerik.Windows.Controls.LocalizationManager.ResourceKey' threw an exception.
  Source=PresentationFramework
  LineNumber=0
  LinePosition=0
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.ResourceDictionary.CreateObject(KeyRecord key)
       at System.Windows.ResourceDictionary.RealizeDeferContent(Object key, Object& value, Boolean& canCache)
       at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
       at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
       at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
       at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
       at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
       at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
       at System.Windows.SystemResources.LookupResourceInDictionary(ResourceDictionary dictionary, Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
       at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
       at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
       at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
       at System.Windows.FrameworkElement.UpdateThemeStyleProperty()
       at System.Windows.FrameworkElement.OnInitialized(EventArgs e)
       at Telerik.Windows.Controls.RadBusyIndicator.OnInitialized(EventArgs e) in c:\TB\101\WPF_Scrum\Current_HotFix\Sources\Development\Core\Controls\BusyIndicator\RadBusyIndicator.cs:line 144
  InnerException: System.ArgumentException
       Message=Object of type 'System.Windows.Setter' cannot be converted to type 'System.Windows.DependencyObject'.
       Source=mscorlib
       StackTrace:
            at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
            at System.RuntimeType.CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr)
            at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
            at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
            at System.Xaml.Schema.XamlMemberInvoker.SetValueSafeCritical(Object instance, Object value)
            at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
       InnerException:




Paulo
Top achievements
Rank 1
 answered on 26 Oct 2011
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
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
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?