The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
When I set
gridGroupingControl1.TableModel.Options.NumberedRowHeaders = true;
I expected that instead of the little triangle thingy on the current record I would see row numbers there... like Excel... but it doesn''t work.
ADAdministrator Syncfusion Team July 22, 2004 02:03 PM UTC
Daniel,
The GridTableRowHeaderCellRenderer (RowHeaderCell celltype) ignores this setting since it does not make sense to display the underlying row index in most cases. Row 1 will be the column headers and records would be offset.
What is better is if you display the record index instead. You can do this by handling the TableControlPrepareViewStyleInfo event and specify "Header" as cell type.
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
DCDaniel ChaitJuly 22, 2004 02:14 PM UTC
Thanks... what''s the difference between
groupingGrid1.TableControlPrepareViewStyleInfo
and
gridGroupingControl1.QueryCellStyleInfo
They seem like they accomplish similar things, no? If I already have code in QueryCellStyleInfo will it clobber the other?
>Daniel,
>
>The GridTableRowHeaderCellRenderer (RowHeaderCell celltype) ignores this setting since it does not make sense to display the underlying row index in most cases. Row 1 will be the column headers and records would be offset.
>
>What is better is if you display the record index instead. You can do this by handling the TableControlPrepareViewStyleInfo event and specify "Header" as cell type.
>
>
>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
>