officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectioncolumns-dot-setcolumns-x28-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-sectioncolumncollection-x29.md
Applies the columns to the section.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
void SetColumns(
SectionColumnCollection columns
)
Sub SetColumns(
columns As SectionColumnCollection
)
| Name | Type | Description |
|---|---|---|
| columns | SectionColumnCollection |
A SectionColumnCollection representing the layout to be applied.
|
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);
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
// Apply layout to the document.
firstSection.Columns.SetColumns(sectionColumnsLayout);
#endregion #CreateColumns
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.cs#L35
firstSection.Columns.CreateUniformColumns(firstSection.Page, 0.2f, 3);
firstSection.Columns.SetColumns(sectionColumnsLayout);
#endregion #CreateColumns
word-document-api-examples/CS/CodeExamples/PageLayoutActions.cs#L58
// Apply the column layout to the section.
firstSection.Columns.SetColumns(sectionColumnsLayout);
#endregion #CreateColumns
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/PageLayout.vb#L32
' Apply layout to the document.
firstSection.Columns.SetColumns(sectionColumnsLayout)
#End Region ' #CreateColumns
wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/PageLayoutActions.vb#L25
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
' Apply the column layout to the section.
firstSection.Columns.SetColumns(sectionColumnsLayout)
#End Region ' #CreateColumns
See Also