or
Helooo,
I have RadBook that contain richtextbox that I want to Bind data to,
My Book Data Template is :
<DataTemplate x:Key ="LeftPageTemplate" > <StackPanel Margin="10" Background="Azure" > <Viewbox Name="ViewSura" Stretch="Fill" StretchDirection="Both" FlowDirection="RightToLeft" HorizontalAlignment="Left" Width="450" Margin="525,21,0,0" Height="600" VerticalAlignment="Top"> <RichTextBox FontSize="22" MaxWidth ="450" MaxHeight ="600" Name="richTextBox1" Document ="{Binding FLD}" VerticalAlignment="Top" Background="Brown" FontStretch="Condensed" FontFamily="KFGQPC Uthmanic Script HAFS" > <RichTextBox.Resources> <Style TargetType="Run"> <EventSetter Event="MouseLeftButtonDown" /> </Style> </RichTextBox.Resources> </RichTextBox > </Viewbox> </StackPanel> </DataTemplate>In in my code Page XML File:
<Window.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="Dictionary1.xaml"></ResourceDictionary> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Window.Resources> <Grid> <telerik:RadBook x:Name="RadBook1" Margin="50" LeftPageTemplate="{StaticResource LeftPageTemplate}" RightPageTemplate="{StaticResource RightPageTemplate}" />In in my C# code I did this:
ObservableCollection<RTBI > MyPages= new ObservableCollection<RTBI>(); for (int i = 0; i < 10; i = i + 1) { ReadSura rs = new ReadSura(); MyPages.Add(new RTBI() { FLD = rs.readsuratxt(i + 1) // This is to get the Flow document .. }); } RadBook1.ItemsSource = MyPages ; }Put I get the error for binding, please what am I doing wrong. Please see the attached image for error details.
Please Help.
Regards...
private void fleetGrid_RowLoaded(object sender, RowLoadedEventArgs e) { var row = e.Row as GridViewRow; if (row != null) { Record recItem = e.Row.Item as Record; row.IsExpandable = recItem.RequiredFields.ShowToggleOnGrid; }}<Window x:Class="RadControlsWpfApp1.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:local="clr-namespace:RadControlsWpfApp1" Title="MainWindow" Height="350" Width="525"> <telerik:RadRibbonView> <telerik:RadRibbonTab Header="Tab 1"> <telerik:RadRibbonGroup Header="Group 1"> <telerik:RadRibbonButton Size="Large">Button 1</telerik:RadRibbonButton> </telerik:RadRibbonGroup> </telerik:RadRibbonTab> <local:UserControl1 /> </telerik:RadRibbonView></Window><telerik:RadRibbonTab x:Class="RadControlsWpfApp1.UserControl1" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Header="Tab 2"> <telerik:RadRibbonGroup Header="Group 2"> <telerik:RadRibbonButton Size="Large">Button 2</telerik:RadRibbonButton> </telerik:RadRibbonGroup></telerik:RadRibbonTab>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 Telerik.Windows.Controls;namespace RadControlsWpfApp1{ /// <summary> /// Interaction logic for UserControl1.xaml /// </summary> public partial class UserControl1 : RadRibbonTab { public UserControl1() { InitializeComponent(); } }}
<telerik:RadWindow x:Class="ExpanderWpfApp.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Height="300" Width="300" > <StackPanel> <TextBox/> <telerik:RadExpander IsExpanded="True" IsTabStop="False"> <TextBox/> </telerik:RadExpander> <TextBox/> </StackPanel></telerik:RadWindow>public class PropertyDefinitionList : List<Telerik.Windows.Controls.Data.PropertyGrid.PropertyDefinition>{ public PropertyDefinitionList() { }}<local:ObjectPropertyFilterListx:Key="PropertyDefinitions"><propertyGrid:PropertyDefinitionBinding="{Binding Name}"/><propertyGrid:PropertyDefinitionBinding="{Binding ID}"/></local:ObjectPropertyFilterList>
I get a reference to this list in my code behind and call it PropertyList. At a certain
point I want to the property definitions to the .PropertyDefinitions collection on the
RadPropertyGrid, so in the function that does it I have the following code:rpg1.PropertyDefinitions.AddRange(propertyDefinitionList1);rpg1.item = targetitem;
However when the code executes I get two blank definition entries in the property grid
display. There is no display name nor value. The properties definitely exist in the object
being assigned to "item", but its like these property definitions don't get their binding
set. In another thread it was stated that property definitions have their binding
evaluated when the .item property changes, so what is happening (or not happening) here? I
figure I must be doing something wrong.
Thanks!