This question is locked. New answers and comments are not allowed.
Hi!
I'm looking for a way to insert a footnote at a specific point in my RadRichTextbox programmatically.
The text of the footnote is stored in my data for a specific Span and should be inserted after the Text in the Span.
I know that the instance of the RadRichTextbox has the method InsertFootnote() or InsertFootnote(Note note) but I can not see
a) howthe position of the footnote is determined (does the 'cursor' of the radRichTextBox stand at the position where the last element was inserted?)
b) howthe text of the footnote can be set.
Can anyone provide a short example how I can insert a footnote at the end of a text, which is positioned in a span? I'm using Silverlight 5 and telerik version Q3 2012. I prepared a code of a code behind file of the MainPage at line 44 I wanted to insert the footnote. Maybe this expample helps to understand my problem and to provide an example for me:
the according xaml (no suprise):
Thanks in advance!
Daniela
I'm looking for a way to insert a footnote at a specific point in my RadRichTextbox programmatically.
The text of the footnote is stored in my data for a specific Span and should be inserted after the Text in the Span.
I know that the instance of the RadRichTextbox has the method InsertFootnote() or InsertFootnote(Note note) but I can not see
a) howthe position of the footnote is determined (does the 'cursor' of the radRichTextBox stand at the position where the last element was inserted?)
b) howthe text of the footnote can be set.
Can anyone provide a short example how I can insert a footnote at the end of a text, which is positioned in a span? I'm using Silverlight 5 and telerik version Q3 2012. I prepared a code of a code behind file of the MainPage at line 44 I wanted to insert the footnote. Maybe this expample helps to understand my problem and to provide an example for me:
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using Telerik.Windows.Documents.Model;namespace FootnoteExample{ public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); this.Loaded += new RoutedEventHandler(MainPage_Loaded); } void MainPage_Loaded(object sender, RoutedEventArgs e) { RadDocument document = new RadDocument(); document.LayoutMode = DocumentLayoutMode.Paged; Section section = new Section(); Table whatEverTable = new Table(); TableRow row = new TableRow(); TableCell cell = new TableCell(); cell.Padding = new Telerik.Windows.Documents.Layout.Padding(0); cell.Padding = new Telerik.Windows.Documents.Layout.Padding(0); Paragraph p2 = new Paragraph(); p2.LineSpacing = 1; Span s2 = new Span(); s2.Text = "This is my text";
string footnotetext = "My footnote text!";
// footnote should be inserted directly after this text p2.Children.Add(s2); cell.Blocks.Add(p2); row.Cells.Add(cell); whatEverTable.AddRow(row); section.Children.Add(whatEverTable); document.Children.Add(section); radRichTextBox.Document = document; } }}<UserControl x:Class="FootnoteExample.MainPage" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <telerik:RadRichTextBox IsSpellCheckingEnabled="False" x:Name="radRichTextBox" ShowComments="False" Margin="24 24 0 0" /> </Grid></UserControl>Thanks in advance!
Daniela
