Back to Devexpress

ListViewLink Class

windowsforms-devexpress-dot-xtraprintinglinks-0280de1a.md

latest3.2 KB
Original Source

ListViewLink Class

A link to print the ListView control.

Namespace : DevExpress.XtraPrintingLinks

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public class ListViewLink :
    ListViewLinkBase,
    IWinLink
vb
Public Class ListViewLink
    Inherits ListViewLinkBase
    Implements IWinLink

Remarks

Use the ListViewLink class to print the ListView control.

To do this, assign an existing ListView object to the ListViewLinkBase.ListView property, and then either call the ListViewLink.ShowPreview (ListViewLink.ShowPreviewDialog) method to preview a document, or the ListViewLink.Print (ListViewLink.PrintDlg) method to send it to a printer.

Example

This example demonstrates how to create and display a Print Preview for the ListView control, via the ListViewLink.

csharp
using System;
using System.Windows.Forms;
using DevExpress.XtraPrintingLinks;
// ...

private void simpleButton1_Click(object sender, EventArgs e) {
    ListViewLink lwLink = new ListViewLink();
    lwLink.ListView = listView1;
    printingSystem1.Links.Add(lwLink);
    lwLink.ShowPreviewDialog();
}
vb
Imports System
Imports System.Windows.Forms
Imports DevExpress.XtraPrintingLinks
' ...

Private Sub simpleButton1_Click(ByVal sender As Object, _ 
ByVal e As EventArgs) Handles simpleButton1.Click
    Dim lwLink As ListViewLink = New ListViewLink()
    lwLink.ListView = listView1
    printingSystem1.Links.Add(lwLink)
    lwLink.ShowPreviewDialog()
End Sub

Inheritance

Object MarshalByRefObject Component LinkBase ListViewLinkBase ListViewLink

See Also

ListViewLink Members

Printing Links

DevExpress.XtraPrintingLinks Namespace