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.
ADAdministrator Syncfusion Team April 13, 2005 09:34 AM
you can check
groupingGrid.Table.CurrentElement is Record
groupingGrid.Table.CurrentElement is CaptionRow
groupingGrid.Table.CurrentElement is HeaderRow
>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.
RIRichardApril 13, 2005 08: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
ADAdministrator Syncfusion Team April 13, 2005 09:09 PM
Given a GridRecord r, you can find its record index using:
int pos = this.gridGroupingControl1.Table.Records.IndexOf(r);
RIRichardApril 14, 2005 08:34 PM
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)
ADAdministrator Syncfusion Team April 14, 2005 08:46 PM