windowsforms-devexpress-dot-xtraprintinglinks-0280de1a.md
A link to print the ListView control.
Namespace : DevExpress.XtraPrintingLinks
Assembly : DevExpress.XtraPrinting.v25.2.dll
NuGet Package : DevExpress.Win.Printing
public class ListViewLink :
ListViewLinkBase,
IWinLink
Public Class ListViewLink
Inherits ListViewLinkBase
Implements IWinLink
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.
This example demonstrates how to create and display a Print Preview for the ListView control, via the ListViewLink.
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();
}
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
Object MarshalByRefObject Component LinkBase ListViewLinkBase ListViewLink
See Also