Ejemplo n.º 1
0
        private Footer CreateFooter()
        {
            RadDocument       footerDocument = new RadDocument();
            RadDocumentEditor editor         = new RadDocumentEditor(footerDocument);

            editor.InsertTable(1, 2);
            editor.ChangeStyleName(RadDocumentDefaultStyles.DefaultNormalTableStyleName);

            editor.Document.Selection.SelectAll();

            editor.ChangeFontFamily(new FontFamily("Arial"));
            editor.ChangeForeColor(Color.FromRgb(29, 192, 34));
            editor.ChangeFontSize(Unit.PointToDip(10));

            editor.Document.Selection.Clear();

            editor.Insert("Copyright © 2002-2015 Telerik. All rights reserved.");

            var table = editor.Document.EnumerateChildrenOfType <Table>().FirstOrDefault();

            editor.Document.CaretPosition.MoveToStartOfDocumentElement(table.Rows.First.Cells.Last);
            table.Grid.Columns.Last().PreferredWidth = new TableWidthUnit(20);

            PageField field = new PageField();

            editor.InsertField(field, FieldDisplayMode.Result);
            editor.ChangeParagraphTextAlignment(RadTextAlignment.Right);

            Footer footer = new Footer()
            {
                Body = footerDocument
            };

            return(footer);
        }
Ejemplo n.º 2
0
        private Footer CreateFooter()
        {
            RadDocument footerDocument = new RadDocument();
            RadDocumentEditor editor = new RadDocumentEditor(footerDocument);

            editor.InsertTable(1, 2);
            editor.ChangeStyleName(RadDocumentDefaultStyles.DefaultNormalTableStyleName);

            editor.Document.Selection.SelectAll();

            editor.ChangeFontFamily(new FontFamily("Arial"));
            editor.ChangeForeColor(Color.FromRgb(29, 192, 34));
            editor.ChangeFontSize(Unit.PointToDip(10));

            editor.Document.Selection.Clear();

            editor.Insert("Copyright © 2002-2015 Telerik. All rights reserved.");

            var table = editor.Document.EnumerateChildrenOfType<Table>().FirstOrDefault();

            editor.Document.CaretPosition.MoveToStartOfDocumentElement(table.Rows.First.Cells.Last);
            table.Grid.Columns.Last().PreferredWidth = new TableWidthUnit(20);

            PageField field = new PageField();
            editor.InsertField(field, FieldDisplayMode.Result);
            editor.ChangeParagraphTextAlignment(RadTextAlignment.Right);

            Footer footer = new Footer() { Body = footerDocument };
            return footer;
        }