Back to Devexpress

SectionColumns.SetColumns(SectionColumnCollection) Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectioncolumns-dot-setcolumns-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectioncolumncollection-x29.md

latest5.7 KB
Original Source

SectionColumns.SetColumns(SectionColumnCollection) Method

Applies the columns to the section.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
void SetColumns(
    SectionColumnCollection columns
)
vb
Sub SetColumns(
    columns As SectionColumnCollection
)

Parameters

NameTypeDescription
columnsSectionColumnCollection

A SectionColumnCollection representing the layout to be applied.

|

Example

View Example

csharp
Document document = server.Document;
document.LoadDocument("Documents\\Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.Docx);
document.Unit = DevExpress.Office.DocumentUnit.Inch;
// Get the first section in a document
Section firstSection = document.Sections[0];
// Create columns and apply them to the document
SectionColumnCollection sectionColumnsLayout =
    firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
firstSection.Columns.SetColumns(sectionColumnsLayout);
vb
Dim document As Document = server.Document
document.LoadDocument("Documents\Grimm.docx", DevExpress.XtraRichEdit.DocumentFormat.Docx)
document.Unit = DevExpress.Office.DocumentUnit.Inch
' Get the first section in a document
Dim firstSection As Section = document.Sections(0)
' Create columns and apply them to the document
Dim sectionColumnsLayout As SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
firstSection.Columns.SetColumns(sectionColumnsLayout)

The following code snippets (auto-collected from DevExpress Examples) contain references to the SetColumns(SectionColumnCollection) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/PageLayout.cs#L35

csharp
// Apply layout to the document.
firstSection.Columns.SetColumns(sectionColumnsLayout);
#endregion #CreateColumns

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.cs#L35

csharp
firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
firstSection.Columns.SetColumns(sectionColumnsLayout);
#endregion #CreateColumns

word-document-api-examples/CS/CodeExamples/PageLayoutActions.cs#L58

csharp
// Apply the column layout to the section.
firstSection.Columns.SetColumns(sectionColumnsLayout);
#endregion #CreateColumns

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/PageLayout.vb#L32

vb
' Apply layout to the document.
            firstSection.Columns.SetColumns(sectionColumnsLayout)
#End Region ' #CreateColumns

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.vb#L25

vb
Dim sectionColumnsLayout As SectionColumnCollection = firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2F, 3)
firstSection.Columns.SetColumns(sectionColumnsLayout)
' #End Region ' #CreateColumns

word-document-api-examples/VB/CodeExamples/PageLayoutActions.vb#L52

vb
' Apply the column layout to the section.
            firstSection.Columns.SetColumns(sectionColumnsLayout)
#End Region ' #CreateColumns

See Also

GetColumns()

SectionColumns Interface

SectionColumns Members

DevExpress.XtraRichEdit.API.Native Namespace