Telerik Forums
UI for WPF Forum
3 answers
759 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
305 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
156 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
270 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
336 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
160 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
230 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
4 answers
165 views
Hi,

I need to populate the dropdown menu available at the bottom of the Radoutlooktoolbar. The idea is to provide menus and submenus when the user clicks the dropdown menu (the small inverted triangle) currently am totally unable to do that. I used ItemDropDownContentTemplate to accomplish this. I used the following code snippet.

 

<

 

 

telerik:RadOutlookBar x:Name="RadOutlookBar1"

 

 

 

MaxWidth="760" ItemsSource="{Binding}"

 

 

 

ItemTemplate="{StaticResource BarTemplate}"

 

 

 

ContentTemplate="{StaticResource redefineoutlook}"

 

 

 

TitleTemplate="{StaticResource BarTemplate}"

 

 

 

Margin="0,0,330,0" ItemDropDownContentTemplate="{StaticResource BarTemplate}">

I am successfully able to populate the Itemtemplate,Content template and the Title templates however the ItemDropdownContentTemplate is the missing link.
Bartemplate is something like below:

 

 

 

 

<DataTemplate x:Key="BarTemplate" >

 

 

 

 

<TextBlock Text="{Binding Path=A}" FontWeight="Bold" />

 

 

 

 

</DataTemplate>

Note:This template works fine in Titletemplate, ItemTemplate. Have no clue why it is not working in ItemDropdownContentTemplate. Kindly advise me where am wrong. Also let me know if there is anyother way to accomplish my requirements. This is rather urgent I need to do this ASAP.

-Kaarthik(skmit87@gmail.com)

 

Petar Mladenov
Telerik team
 answered on 26 Oct 2011
8 answers
405 views

Using Telerik WPF for .NET 4

OS: Windows Server 2008

Assuming a RadGridView named "grid" is defined in XAML the following code works in

WPF Version 2011.2.712.40 but not in later versions such as 2011.2.920.40 or 2011.2.1010.40.

Calling grid.Rebind() however works for all versions.

Expected result:

Calling mi1_Click should update the value in the first cell of the grid.

public partial class MainWindow : Window
    {
        private ObservableCollection<MyDynamicObject> myObjects;
        private int Counter;
          
        public MainWindow()
        {
            InitializeComponent();
            myObjects = new ObservableCollection<MyDynamicObject>();
            for (int i = 0; i < 5; i++)
            {
                dynamic myObject = new MyDynamicObject();
                myObjects.Add(myObject);
            }
            GridViewDataColumn col = new GridViewDataColumn();
            col.Header = "Prop1";
            col.DataMemberBinding = new Binding("Prop1");
            col.DataType = typeof(string);
            grid.Columns.Add(col);
            grid.ItemsSource = myObjects;
        }
  
        private void mi1_Click(object sender, RoutedEventArgs e)
        {
            MyDynamicObject myObj = myObjects[0];
            Counter++;
            myObj.PropertyDict["Prop1"] = Counter.ToString();
            myObj.NotifyPropertyChanged("Prop1");
        }
    }
  
    public class MyDynamicObject : DynamicObject, INotifyPropertyChanged
    {
        public readonly Dictionary<string, object> PropertyDict;
        public event PropertyChangedEventHandler PropertyChanged;
  
        public void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
          
        public MyDynamicObject()
        {
            PropertyDict = new Dictionary<string, object>();   
        }
         
        public override bool TryGetMember(GetMemberBinder binder, out object result)
        {
            string propertyName = binder.Name;
            object obj1;
            result = null;
            if (PropertyDict.TryGetValue(propertyName, out obj1))
                result = obj1;
            return true;
        }
  
        public override bool TrySetMember(SetMemberBinder binder, object value)
        {
            string propertyName = binder.Name;
            PropertyDict[propertyName] = value;
            return true;
        }
    }
Nedyalko Nikolov
Telerik team
 answered on 26 Oct 2011
1 answer
55 views
Hi,
How can I populate a StackedArea1003D chart at code behind?
I have a collection of Date(x axis), Price(y axis) and Delta(z axis) to show on chart.

Evgenia
Telerik team
 answered on 26 Oct 2011
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?