Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Model.RadDocument.GetCaretInline() Line 1319 C#
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.Model.RadDocument.GetCurrentSpanStyle() Line 1336 + 0xc bytes C#
Telerik.Windows.Documents.dll!Telerik.Windows.Controls.RadRichTextBox.UpdateCurrentStyles() Line 2974 + 0x20 bytes C#
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.DoOnCaretLocationChanged() Line 441 C#
Telerik.Windows.Documents.dll!Telerik.Windows.Documents.UI.DocumentWebLayoutPresenter.DoOnDocumentChanged.AnonymousMethod__6() Line 409 + 0xa bytes C#
//Line 1319 in RadDocument.cs
SpanLayoutBox previousSpanBox = DocumentStructureCollection.GetPreviousSiblingForDocumentElement(currentSpanBox,
currentSpanBox.Parent.AssociatedDocumentElement)
as
SpanLayoutBox;
// ^^^^^NullReferenceException: Parent is null sometimes
RadDocument doc = editor.Document;
var span1 =
new
Span(
"This text is protected"
);
// doc.InsertInline(span1); //this span's spanbox will have no Parent, causing a Null ref
(doc.Sections.Last.Blocks.Last
as
Paragraph).Inlines.Add(span1);
//this span's spanbox will have a Parent, not causing a Null ref
DocumentPosition pos3 =
new
DocumentPosition(doc.DocumentLayoutBox,
true
);
var spb1 = span1.FirstLayoutBox
as
SpanLayoutBox;
pos3.MoveToInline(spb1, 0);
DocumentPosition pos4 =
new
DocumentPosition(doc.DocumentLayoutBox,
true
);
pos4.MoveToInline(spb1, spb1.PositionsCountInBox - 1);
doc.InsertReadOnlyRange(pos3, pos4);
// raises Null ref in RadDocument.GetCaretInline if using "doc.InsertInline"
When the view is initially loaded, the RadPanes start out open, and then immediately shut. This is visible and distracting. I really want them to just be closed from the get go.How can I make it so the RadPanes in a RadPaneGroup are initially closed (unpinned)?
How can I make it so the RadPanes in a RadPaneGroup are initially closed (unpinned)?
Code snipet:
<radDock:RadDocking x:Name="radDocking1" Background="{StaticResource WindowBackgroundBrush}"> |
<radDock:RadDocking.DocumentHost> |
<!-- controls here --> |
</radDock:RadDocking.DocumentHost> |
<radDock:RadSplitContainer radDock:DockingPanel.InitialSize="300,300" MaxWidth="600" |
Name="RightContainer" InitialPosition="DockedRight"> |
<radDock:RadPaneGroup x:Name="_librariesGroup"> |
<radDock:RadPane x:Name="_requirementsLibraryPane" Header="Requirements Library" |
CanFloat="False" CanUserClose="False" CanUserPin="True" IsPinned="False"> |
<my1:RequirementsLibraryDrawerControl x:Name="_requirementsLibraryDrawer" /> |
</radDock:RadPane> |
</radDock:RadPaneGroup> |
</radDock:RadSplitContainer> |
</radDock:RadDocking> |
I am trying to implement a ContextMenu for a treeview control (WPF) by using your Telerik's online tutorial. However, I often get error message as I copy & paste the tutorial code.
Here is what I have in XAML:
<telerik:RadTreeView Canvas.Left="18" Canvas.Top="136" Height="615" Name="raceTreeView" Width="311" Background="Bisque" IsLineEnabled="True">
<!-- This code segement implements a popup menu on the treeview.-->
<telerik:RadContextMenu.ContextMenu>
<telerik:RadContextMenu ItemClick="TreeContextMenu_ItemClick">
<telerik:RadMenuItem Header="Add" />
<telerik:RadMenuItem Header="Delete" />
<telerik:RadMenuItem Header="Edit" />
</telerik:RadContextMenu>
</telerik:RadContextMenu.ContextMenu>
</telerik:RadTreeView>
Here is the relevant segements in C# code-behind:
using Telerik.Windows;
using Telerik.Windows.Controls;
using Telerik.Windows.Data;
....
private void TreeContextMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
MenuItem item = (e.OriginalSource as RadMenuItem).DataContext as MenuItem;
switch ( item.Text )
{
case "Add":
....
case "Edit":
....
case "Delete":
....
}
}
}
I get an error message on this line : switch ( item.Text )
'System.Windows.Controls.MenuItem' does not contain a definition for 'Text' and no extension method 'Text' accepting a first argument of type 'System.Windows.Controls.MenuItem' could be found (are you missing a using directive or an assembly reference?)
How can I solve this problem?
Thanks,
Hamid
Please disregard this post. I found the error.
Thanks,
Hamid
I am in the process of evaluating Telerik controls for WPF. I started by added a RadTabControl
to my main window (window1). I then set up 3 RadTabItems by using the collection editor
under the Items property of the RadTabControl. Dragging other controls from the toolbox
over to specific RadTabItems doesn't appear to work. I manually went into the XAML code
and inserted a calendar control on RadTabItem(2), and it shows up when running the
program, it does not show when in design mode however. I'm further confused by how
you would go about adding multiple controls to a RadTabItem. I am currently using
Visual Studio 2008 Version 9.0.21022.8 .Net Framework 3.5. Here is my current
XAML code. I'm wondering if someone could give me some pointers on what I'm
doing wrong ?
<
Window
x:Class
=
"Window1"
Title
=
"Window1"
Height
=
"300"
Width
=
"708"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
>
<
Grid
>
<
telerik:RadTabControl
Margin
=
"39,51,94,45"
Name
=
"RadTabControl1"
TabOrientation
=
"Vertical"
TabStripPlacement
=
"Left"
>
<
telerik:RadTabItem
AllowDrop
=
"True"
Header
=
"Tab1"
Name
=
"RTI1"
></
telerik:RadTabItem
>
<
telerik:RadTabItem
AllowDrop
=
"True"
Header
=
"Tab2"
Name
=
"RTI2"
>
<
telerik:RadCalendar
Name
=
"RadCalendar1"
HorizontalAlignment
=
"Left"
Width
=
"121"
ClipToBounds
=
"True"
telerik:StyleManager.Theme
=
"Metro"
></
telerik:RadCalendar
>
</
telerik:RadTabItem
>
<
telerik:RadTabItem
AllowDrop
=
"True"
Header
=
"Tab3"
Name
=
"RTI3"
></
telerik:RadTabItem
>
</
telerik:RadTabControl
>
</
Grid
>
</
Window
>