Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
15054 | Jun 10,2004 12:38 PM UTC | Jun 30,2004 10:45 AM UTC | WinForms | 9 |
![]() |
Tags: Grouping |
this.groupingGrid1.TableModel.QueryCoveredRange += new Syncfusion.Windows.Forms.Grid.GridQueryCoveredRangeEventHandler(TableModel_QueryCoveredRange);
}
private void TableModel_QueryCoveredRange(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCoveredRangeEventArgs e)
{
GridTableModel tm = sender as GridTableModel;
Element el = tm.Table.DisplayElements[e.RowIndex];
if (el is ColumnHeaderRow)
{
GridTableCellStyleInfo style = tm[e.RowIndex, e.ColIndex];
// You could use Column name here
//if (style.TableCellIdentity.Column.Name == "CustomerID"
// || style.TableCellIdentity.Column.Name == "CompanyName")
// or - more simple - just use the underlying grids column index.
if (e.ColIndex >= 3 && e.ColIndex <= 4)
e.Range = GridRangeInfo.Cells(e.RowIndex, 3, e.RowIndex, 4);
e.Handled = true;
}
}
Stefan
if (el is ColumnHeaderRow)
{
GridTableCellStyleInfo style = tm[e.RowIndex, e.ColIndex];
if (style.TableCellIdentity.Column.Name == POSITION
||
style.TableCellIdentity.Column.Name == POSITIONADJ)
{
int startCol = el.GroupLevel+1;
int colIndex = e.ColIndex;
if (style.TableCellIdentity.Column.Name == POSITIONADJ)
colIndex--;
e.Range = GridRangeInfo.Cells(e.RowIndex, colIndex, e.RowIndex, colIndex + 1);
e.Handled = true;
}
}
I attached a modified form1.cs
Form1_2269.zip
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.