How to print a Infragistics grid on click of button btnPrint.

using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{

	// InitializeLayout gets fired for the UltraGrid's layout as well as when printing.
	if ( e.Layout.IsPrintLayout )
	{
		// This is a print layout. When printing, use White as the background color.
		e.Layout.Appearance.BackColor = Color.White;

		// Hide the second band (band 1) when printing so rows from that band and its
		// descendant bands don't show up in the print.
		e.Layout.Bands[1].Hidden = true;
	}
	else
	{
		e.Layout.Appearance.BackColor = Color.Gray;
	}		

	// Set the behaviour of tab keys in the UltraGrid.
	this.ultraGrid1.DisplayLayout.TabNavigation = TabNavigation.NextCell;

}

hope this cod will help u

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.