We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

GridGroupingControl.TableModel.Options.NumberedRowHeaders

Thread ID:

Created:

Updated:

Platform:

Replies:

16713 Jul 22,2004 08:55 AM Jul 22,2004 10:14 AM Windows Forms 2
loading
Tags: Grouping
Daniel Chait
Asked On July 22, 2004 08:55 AM

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.

Administrator [Syncfusion]
Replied On July 22, 2004 10:03 AM

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

Daniel Chait
Replied On July 22, 2004 10:14 AM

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 >

CONFIRMATION

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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;