Telerik.Windows.Documents.Model.Paragraph NextPara; try { Telerik.Windows.Documents.Model.Span spanbox = editor.Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan; if(spanbox.FontWeight==FontWeights.Bold && spanbox.ForeColor==Colors.Aqua) { Telerik.Windows.Documents.Model.Section currsect = editor.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection; Telerik.Windows.Documents.Model.Span currspan = editor.Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan; bool check = editor.Document.CaretPosition.MoveToNextInline(); bool c=editor.Document.CaretPosition.MoveToNextInline(); bool c1=editor.Document.CaretPosition.MoveToNextInline(); var documentelement = editor.Document.CaretPosition.GetCurrentParagraphBox(); if (documentelement != null && documentelement.GetType() == typeof(Telerik.Windows.Documents.Layout.ParagraphLayoutBox)) { Telerik.Windows.Documents.Model.Paragraph para = documentelement.AssociatedParagraph; spanbox.Tag = Guid.NewGuid().ToString(); string spantext = (para.Inlines.FirstOrDefault() as Telerik.Windows.Documents.Model.Span).Text; if (!string.IsNullOrEmpty(spantext) && spantext == "[@[") { NextPara = para.NextSibling as Telerik.Windows.Documents.Model.Paragraph; //var DocEle = new DocumentElementCollection(para); //foreach (var item in para.Children) //{ // DocEle.Add(item); //} currsect.Children.Remove(para); //DocumentEleCollection.Add(DocEle); while (NextPara !=null) { if (NextPara !=null && (NextPara.Inlines.FirstOrDefault() as Telerik.Windows.Documents.Model.Span).Text == "]@]") { //var DocEle2 = new DocumentElementCollection(NextPara); //foreach (var item in NextPara.Children) //{ // DocEle2.Add(item); //} currsect.Children.Remove(NextPara); //DocumentEleCollection.Add(DocEle2); break; } //var DocEle1 = new DocumentElementCollection(NextPara); //foreach (var item in NextPara.Children) //{ // DocEle1.Add(item); //} currsect.Children.Remove(NextPara); //DocumentEleCollection.Add(DocEle1); NextPara = NextPara.NextSibling as Telerik.Windows.Documents.Model.Paragraph; } } } } } catch (Exception ex) { }how should I do this, using the DragDropManager ? (I have also looked at the other handlers, but the only one I can find something about the visual is the DragInitialize handler, and it is not fired, since the dragged object does not come from inside the itemsControl)
thanks
Telerik.Windows.Documents.Model.Span spanbox = editor.Document.CaretPosition.GetCurrentSpanBox().AssociatedSpan; StyleDefinition expansionstyle = new StyleDefinition(); expansionstyle.SpanProperties = new SpanProperties() { FontWeight = FontWeights.SemiBold, ForeColor = Colors.Brown }; if (spanbox.FontWeight == FontWeights.SemiBold && spanbox.ForeColor == Colors.Brown) { Telerik.Windows.Documents.Model.Section currsect = editor.Document.CaretPosition.GetCurrentSectionBox().AssociatedSection; bool check = editor.Document.CaretPosition.MoveToNextInline(); var documentelement = editor.Document.CaretPosition.GetCurrentTableBox(); if (documentelement!=null && documentelement.GetType() == typeof(TableLayoutBox)) { spanbox.Tag = Guid.NewGuid().ToString(); //var tableStyle = editor.Document.StyleRepository["TableGrid"] as StyleDefinition; Telerik.Windows.Documents.Model.Table tbl = documentelement.AssociatedTable; if (tbl != null) { TableHelper Thelp = new TableHelper(); Thelp.TableReferenceId = spanbox.Tag; foreach (Telerik.Windows.Documents.Model.TableRow c in tbl.Rows) { TableRowHelper rowhelper = new TableRowHelper(); foreach (Telerik.Windows.Documents.Model.TableCell cell in c.Cells) { TableCellHelper cellhepl = new TableCellHelper(); foreach (DocumentElement block in cell.Blocks) { DocumentElementCollection docelement = new DocumentElementCollection(block); foreach (var item in block.Children) { docelement.Add(item); } cellhepl.DocumentElementCollection.Add(docelement); } rowhelper.TableCellCollection.Add(cellhepl); } Thelp.TableRowHelperCollection.Add(rowhelper); } TableHelpCollection.Add(Thelp); ExpandedColl.Add(spanbox.Tag, tbl); //stylecoll.Add(spanbox.Tag, tableStyle); } styles.Add(spanbox.Tag, documentelement.AssociatedTable.Style); currsect.Blocks.Remove(tbl); //editor.Document.StyleRepository.Add(tableStyle); }I have a custom connection class as shown below. I have removed the 5 connectors of my nodes ("Auto", "Left", "Right", "Top", "Bottom") and added my own connectors "In" and "Out".
public class MyChartConnection : RadDiagramConnection
{
public MyChartConnection(MyLink link)
: base()
{
SourceConnectorPosition = /*ConnectorPosition.Auto*/ "in";
SourceCapType = link.SourceCapType;
TargetConnectorPosition = /*ConnectorPosition.Auto*/ "out";
TargetCapType = link.TargetCapType;
}
}
This crashes when I try to apply your TreeLayout(). Apparently, it cannot find the "Bottom" connector... Should I use another layout class? Do I have to implement my own layout class?