Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
19714 | Oct 1,2004 12:46 PM UTC | Oct 1,2004 07:25 PM UTC | WinForms | 5 |
![]() |
Tags: GridControl |
if (e.RowIndex < thisTable.DisplayElements.Count)
{
Element el = thisTable.DisplayElements[e.RowIndex];
switch (el.Kind)
{
case DisplayElementKind.Caption:
{
int maxCaptionColCount = Math.Max(this.GetColumnIndentCount(), TableDescriptor.GetColCount()-1);
int startCol = el.GroupLevel+1;
IGridGroupOptionsSource g = el.ParentGroup as IGridGroupOptionsSource;
if (g != null && !g.GroupOptions.ShowCaptionPlusMinus)
{
startCol--;
}
int d = (ParentTableDescriptor.Relations.NestedCount > 0) ? 1 : 0;
if (!((GridTable) el.ParentTable).TableOptions.ShowRecordPlusMinus)
d = 0;
if (e.ColIndex >= startCol && e.ColIndex <= maxCaptionColCount)
{
if (g == null || !g.GroupOptions.ShowCaptionSummaryCells)
{
e.Range = GridRangeInfo.Cells(e.RowIndex, startCol, e.RowIndex, maxCaptionColCount);
e.Handled = true;
}
else
{
e.Range = GridRangeInfo.Cell(e.RowIndex, e.ColIndex);
if (e.Range.Left <= GetColumnIndentCount())
{
e.Range = e.Range.UnionRange(GridRangeInfo.Cells(e.Range.Top, el.GroupLevel+1+d, e.Range.Bottom, GetColumnIndentCount()));
e.Handled = true;
}
}
}
else if (e.ColIndex == el.GroupLevel)
{
e.Range = GridRangeInfo.Cell(e.RowIndex, e.ColIndex);
e.Handled = true; // PlusMinus
}
else if (e.ColIndex > maxCaptionColCount)
{
e.Range = GridRangeInfo.Cell(e.RowIndex, e.ColIndex);
e.Handled = true;
}
break;
}
Next step would be to handle QueryCellStyleInfo for those cells at the top and manually set e.Style.CellValue.
Stefan This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.