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.
Syncfusion Feedback

Looping through a GGC current record (selected record) and getting headers

Thread ID:

Created:

Updated:

Platform:

Replies:

57128 Feb 26,2007 07:59 PM UTC Feb 28,2007 12:01 AM UTC Windows Forms 3
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On February 26, 2007 07:59 PM UTC

Hi,
Can I loop through an actively selected record in a GGC and get the column headers as well as the value in that Row, Col?
I'm able to get individual values using:

this.trancheGridGrouper.Table.Records.Count...

this.myGGC.TableModel[x, y].Text

but I would like to do it by the header and get the header so I can pass it with the cell value

Thanks,
Dimitri

Administrator [Syncfusion]
Replied On February 26, 2007 10:23 PM UTC

Hi Dimitri,

You can turn ON the record based selection using ListBoxSelectionModeproperty and call the Table.GetTableCellStyle method to get the selected record cell style information using the column header name.Below is a code snippet.

foreach( SelectedRecord rec in this.gridGroupingControl1.Table.SelectedRecords)
{
GridTableCellStyleInfo style = this.gridGroupingControl1.Table.GetTableCellStyle(rec.Record,"ColumnHeaderName");
Console.WriteLine( style.Text );
}

Sample : http://www.syncfusion.com/Support/user/uploads/GGC_ColumnHeader_c188c538.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 27, 2007 04:18 PM UTC

Thanks Haneef,
Will that give me the cell content for that selected record and header? I would like to get the cell value by knowing the column header name,
The CellStyle equivalent of:

this.GGC.TableModel[row, 2].Text;



Dimitri

>Hi Dimitri,

You can turn ON the record based selection using ListBoxSelectionModeproperty and call the Table.GetTableCellStyle method to get the selected record cell style information using the column header name.Below is a code snippet.

foreach( SelectedRecord rec in this.gridGroupingControl1.Table.SelectedRecords)
{
GridTableCellStyleInfo style = this.gridGroupingControl1.Table.GetTableCellStyle(rec.Record,"ColumnHeaderName");
Console.WriteLine( style.Text );
}

Sample : http://www.syncfusion.com/Support/user/uploads/GGC_ColumnHeader_c188c538.zip

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 28, 2007 12:01 AM UTC

Hi Dimitri,

The CellStyle equivalent of: this.GGC.TableModel[row, 2].Text;
>>>>>>
You can try the below code snippet

//Get ColumnName from ColIndex.
int field = this.gridGroupingControl1.TableDescriptor.ColIndexToField(2);
string ColumnName = this.gridGroupingControl1.TableDescriptor.Fields[field].Name;

//Get Recor from RowIndex.
Record rec =this.gridGroupingControl1.Table.DisplayElements[row].ParentRecord;

GridTableCellStyleInfo style = this.gridGroupingControl1.Table.GetTableCellStyle(rec,ColumnName);
Console.WriteLine( style.Text );

Best regards,
Haneef

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.

Warning Icon 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.Close Icon

;