private void exporter_ExcelCellFormatting(object sender, ExcelCellFormattingEventArgs e)
{
if (e.GridRowInfoType == typeof(GridViewDataRowInfo))
{
//update progress bar
int position = (int)(100 * (double)e.GridRowIndex / (double)(GetVisibleRows(this.radGridView.ChildRows)));
this.UpdateProgressBar(position);
this.radProgressBar.IndicatorElement1.UpdateLayout();
}
}
public long GetVisibleRows(GridViewChildRowCollection rows)
{
long i = 0;
foreach (GridViewRowInfo row in rows)
{
if (row is GridViewGroupRowInfo)
{
i += GetVisibleRows(row.ChildRows);
continue;
}
i += 1;
}
return i;
}
private void UpdateProgressBar(int value)
{
if (this.InvokeRequired)
{
this.Invoke(new EventHandler(delegate
{
if (value < 100)
{
this.radProgressBar.Value1 = value;
}
else
{
this.radProgressBar.Value1 = 100;
}
}));
}
else
{
if (value < 100)
{
this.radProgressBar.Value1 = value;
}
else
{
this.radProgressBar.Value1 = 100;
}
}
}
Thanks