private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
switch (e.TableCellIdentity.TableCellType)
{
case GridTableCellType.SummaryFieldCell:
{
GridTable table = e.TableCellIdentity.Table;
GridSummaryColumnDescriptor sumCol1 = e.TableCellIdentity.SummaryColumn;
GridSummaryRow row = e.TableCellIdentity.DisplayElement as GridSummaryRow;
//GridSummaryRowDescriptor summaryRowDescriptor = row.SummaryRowDescriptor;
if (sumCol1 != null)
{
string unformattedValue = sumCol1.GetDisplayText(table, row);
string formattedText = "*" + unformattedValue; // do formatting here ...
e.Style.CellValue = formattedText;
e.Handled = true;
/*
// you could also directly access underlying SummaryDescriptor and get the value directly from there
SummaryDescriptor sd1 = sumCol1.SummaryDescriptor;
if (sd1 != null)
{
int indexOfSd1 = table.TableDescriptor.Summaries.IndexOf(sd1);
ISummary sum1 = el.ParentGroup.GetSummaries(table)[indexOfSd1];
// strong typed - you have to cast to Int32AggregateSummary (or whatever appropriate summary you need in that case ...)
DoubleAggregateSummary summary1 = (DoubleAggregateSummary) el.ParentGroup.GetSummaries(table)[indexOfSd1];
e.Style.Text = string.Format("{0:c}", summary1.Average);
}
*/
}
break;
}
}
}
For resizing individual rows in the grid check out the ResizableRows example that is shipped with the 3.0 Release Candidate.
Stefan
private void button2_Click(object sender, System.EventArgs e)
{
int ticks = Environment.TickCount;
this.gridGroupingControl1.BeginUpdate();
Graphics g = Graphics.FromHwnd(this.gridGroupingControl1.TableControl.Handle);
for(int j = 1; j