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.

columnheader text of a selected cell

Thread ID:

Created:

Updated:

Platform:

Replies:

71297 Jan 25,2008 01:06 AM Jan 28,2008 04:22 AM Windows Forms 1
loading
Tags: GridControl
John Ruiz
Asked On January 25, 2008 01:06 AM

Hello,

Please suggest how i could get the column header text of a selected cell. For now I am doing the below but it seems the same is not valid for grouped rows

int colIndex = gridGroupingControl.TableControl.CurrentCell.Renderer.CurrentCell.ColIndex - 1;
String headerText = gridGroupingControl.TableDescriptor.Columns[colIndex].HeaderText;

Thanks


Fathima Shalini P [Syncfusion]
Replied On January 28, 2008 04:22 AM

Hi John,

Thank you for your interest in Syncfusion Products.

The header text of the selected cell can be retrieved using TableControlCellClick event of the GridGrouping Control, even when the control is grouped.


void gridGroupingControl1_TableControlCellClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e)
{
int field = e.TableControl.TableDescriptor.ColIndexToField(e.Inner.ColIndex);
Console.WriteLine(e.TableControl.TableDescriptor.Columns[field].HeaderText);
}


Please have a look at the following sample that illustrates this:

http://websamples.syncfusion.com/samples/Grouping.Windows/F71297/main.htm

Please let me know if any concerns.

Regards,
Fathima


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.

;