or
Dim content As String = "<
img
src
=
'c:\image1.png'
/>"
Dim htmlProvider As New HtmlFormatProvider()
Dim raddoc As RadDocument = htmlProvider.Import(content)
Dim rtfProvider As New RtfFormatProvider()
Dim rtf As String = rtfProvider.Export(raddoc)
<
telerikRTF:RtfDataProvider
Rtf
=
"{Binding rtf}"
RichTextBox
=
"{Binding ElementName=rrtb}"
/>
<
telerik:RadRichTextBox
Grid.Row
=
"1"
Name
=
"rrtb"
/>
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();
}
}
}