Hi, I have a loop where I am filling the grid and immediatelly print the grid. All printed documents have the same grid values of the last loaded records to the grid DataSource. Is there something I can do to properly print the grid with correct cell values from actual records?
foreach
(var run
in
_runsToPrint)
{
FillReportedAnalytesGrid();
PrintPreview.PrintGrid(rgvReportedAnalytes, run);
}
private
void
FillReportedAnalytesGrid()
{
var records = provider.GetReportedResults();
rgvReportedAnalytes.DataSource =
null
;
rgvReportedAnalytes.DataSource = records;
rgvReportedAnalytes.BestFitColumns(BestFitColumnMode.AllCells);
rgvReportedAnalytes.Refresh();
}
public
static
void
PrintGrid(RadGridView view,
string
run)
{
var document =
new
RadPrintDocument();
view.Print(
false
, document);
}