PrintDocument printDocument = new PrintDocument();
printDocument.PrintPage += delegate (object sndr, PrintPageEventArgs args)
{
args.Graphics.DrawString("gridControl ile seçili olan satır", this.Font, Brushes.Black, new PointF());
args.HasMorePages = false;
};
PrintDialog printDialog = new PrintDialog();
printDialog.Document = printDocument;
if (printDialog.ShowDialog() == DialogResult.OK)
printDocument.Print();
gridControl ile seçili olan satır yazdım onun yerine, bir yazdırmak istediğiniz string ifadeyi oluşturmalısınız. O size kalmış nasıl yazdırmak istiyorsanız
şöyle birşey
String result = gridControl.SelectedRows[0].Cells[0].Value.ToString() + "Kullanıcısının bilgileri şu şekildedir. \n\n"
"Telefon: "+ gridControl.SelectedRows[0].Cells[2].Value.ToString() + "\t"
"Fax :"+ gridControl.SelectedRows[0].Cells[3].Value.ToString() + "\n"
"Adres:"+ gridControl.SelectedRows[0].Cells[4].Value.ToString() + "\n";