this.groupingGrid1.TableControlPrepareViewStyleInfo += new GridTableControlPrepareViewStyleInfoEventHandler(groupingGrid1_TableControlPrepareViewStyleInfo);
private void groupingGrid1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.Inner.Style;
if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordRowHeaderCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordRowHeaderCell)
{
Record r = style.TableCellIdentity.DisplayElement.ParentRecord;
int recordIndex = r.ParentTable.Records.IndexOf(r);
string displayText = recordIndex.ToString();
e.Inner.Style.CellValue = displayText;
e.Inner.Style.CellType = "Header";
}
}
Stefan
>this.groupingGrid1.TableControlPrepareViewStyleInfo += new GridTableControlPrepareViewStyleInfoEventHandler(groupingGrid1_TableControlPrepareViewStyleInfo);
>
>private void groupingGrid1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
>{
> GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.Inner.Style;
> if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordRowHeaderCell
> || style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordRowHeaderCell)
> {
> Record r = style.TableCellIdentity.DisplayElement.ParentRecord;
> int recordIndex = r.ParentTable.Records.IndexOf(r);
>
> string displayText = recordIndex.ToString();
>
> e.Inner.Style.CellValue = displayText;
> e.Inner.Style.CellType = "Header";
> }
>}
>
>
>
>Stefan
>