Back to Devexpress

EditingFieldExtensions.RegisterEditorInfo(InplaceEditorInfoBase) Method

wpf-devexpress-dot-xpf-dot-printing-dot-editingfieldextensions-dot-registereditorinfo-x28-devexpress-dot-xpf-dot-printing-dot-inplaceeditorinfobase-x29.md

latest3.2 KB
Original Source

EditingFieldExtensions.RegisterEditorInfo(InplaceEditorInfoBase) Method

Registers a custom editor to be used to change control content in Print Preview.

Namespace : DevExpress.Xpf.Printing

Assembly : DevExpress.Xpf.Printing.v25.2.dll

NuGet Package : DevExpress.Wpf.Printing

Declaration

csharp
public bool RegisterEditorInfo(
    InplaceEditorInfoBase editorInfo
)
vb
Public Function RegisterEditorInfo(
    editorInfo As InplaceEditorInfoBase
) As Boolean

Parameters

NameTypeDescription
editorInfoInplaceEditorInfoBase

Provides information about a custom editor.

|

Returns

TypeDescription
Boolean

true, if an editor has been successfully registered; otherwise, false.

|

Remarks

Use this method to register an image editor with a collection of predefined images in the application.

csharp
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using DevExpress.Xpf.Printing;
//...
List<Image> images = new List<Image>();
foreach (var file in Directory.GetFiles("../../Flags/", "*.png")) {
    Image img = Image.FromFile(file);
    if (img != null) {
        images.Add(img);
    }
}
ImageCollectionEditorInfo editorInfo = new ImageCollectionEditorInfo("Nationality", images, true, true, "Nationality");
EditingFieldExtensions.Instance.RegisterEditorInfo(editorInfo);
vb
Option Infer On

Imports System.Collections.Generic
Imports System.Drawing
Imports System.IO
Imports DevExpress.Xpf.Printing
'...
Private images As New List(Of Image)()
For Each file In Directory.GetFiles("../../Flags/", "*.png")
    Dim img As Image = Image.FromFile(file)
    If img IsNot Nothing Then
        images.Add(img)
    End If
Next file
Private editorInfo As New ImageCollectionEditorInfo("Nationality", images, True, True, "Nationality")
EditingFieldExtensions.Instance.RegisterEditorInfo(editorInfo)

To learn how to use custom controls to edit reports in Print Preview, view the following example online: How to use custom controls for editing report content in Print Preview.

See Also

EditingFieldExtensions Class

EditingFieldExtensions Members

DevExpress.Xpf.Printing Namespace