Click here to Skip to main content
15,881,803 members

Comments by Alex Perepletov (Top 2 by date)

Alex Perepletov 11-Aug-11 1:12am View    
Is it WinForms DataGridView? In DataGridView one would wire to the CellPainting event. In the event handler, one would get a row from DataSource at index e.RowIndex, and set e.CellStyle.BackColor accordingly.
Alex Perepletov 21-Jul-11 14:41pm View    
PrintDocument raises the PrintPage event repeatedly, as long as the previous call to PrintPage handler returns e.HasMorePages == true. Setting e.HasMorePages inside the loop has no effect on the number of calls to the PrintPage. Only the last 'e.HasMorePages = false' counts. You should change your code, - make 'cl' member variable, - at the end of the function, make 'e.HasMorePages = cl <= 5;' - do not dispose of the dsPRTDB.