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.

Is current row a header row

Thread ID:

Created:

Updated:

Platform:

Replies:

27471 Apr 13,2005 09:28 AM Apr 14,2005 09:46 PM Windows Forms 5
loading
Tags: GridControl
Rich
Asked On April 13, 2005 09:28 AM

how can I test to find out if the current selected row is a grouping/header row, or a regular record in a grouping grid. NOTE: i need to find this out from a non grid event, ie. a non grid button click.

Administrator [Syncfusion]
Replied On April 13, 2005 10:34 AM

Hi Rich, you can check groupingGrid.Table.CurrentElement is Record or groupingGrid.Table.CurrentElement is CaptionRow or groupingGrid.Table.CurrentElement is HeaderRow Stefan >how can I test to find out if the current selected row is a grouping/header row, or a regular record in a grouping grid. > >NOTE: i need to find this out from a non grid event, ie. a non grid button click.

Richard
Replied On April 13, 2005 09:28 PM

Thanks Stefan, that does the trick, just a couple of things though. When you guys post replies, could you make everything verbose, eg. it took me a while to find out that Record was actually in the Syncfusion.Grouping namespace. Thanks Also, is there a simple way to get the record index, in the same circumstances. I am getting it using a different method, but it is creating a bit of overhead

Administrator [Syncfusion]
Replied On April 13, 2005 10:09 PM

Given a GridRecord r, you can find its record index using: int pos = this.gridGroupingControl1.Table.Records.IndexOf(r);

Richard
Replied On April 14, 2005 09:34 PM

Thanks, I have used the following code GridRecord r = (GridRecord)this.grdGrpObjects.Table.CurrentElement; int pos = this.grdGrpObjects.Table.Records.IndexOf(r); but this returns the row number of records only, and does not take grouping records into account. Grouping records cause this to fail. I need to get the the value including grouping headers. eg. this does what I want but has too much overhead, being executed over and over. private void grdGrpObjects_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e) { System.Console.WriteLine(e.Inner.RowIndex.ToString()); }

Administrator [Syncfusion]
Replied On April 14, 2005 09:46 PM

Try using: this.gridGroupingControl1.Table.DisplayElements.IndexOf(r)

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.

;