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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Getting the display text of a GridGroupingControl cell

Thread ID:





59144 Apr 5,2007 02:36 PM UTC Jun 29,2007 09:34 PM UTC WinForms 7
Tags: GridControl
Asked On April 5, 2007 02:36 PM UTC

How can I get the display text of a particular GridGroupingControl cell? The Record.GetValue(...).ToString() statement does not nesessarily give the display text. For example, the actual text displayed in the cell that holds the DateTime value is "7/8/1996 8:00 AM", while Record.GetValue(...).ToString() returns "7/8/1996 8:00:00 AM" (i.e. with seconds).

haneefm [Syncfusion]
Replied On April 5, 2007 03:22 PM UTC

Hi Helen,

You can try this code.

string DisplayText = this.grid.Table.GetTableCellStyle(rec,"ColumnName").FormattedText;

Best regards,

Replied On April 6, 2007 06:59 AM UTC

Thanks! And how to do the same for a nested table?

Replied On April 6, 2007 01:41 PM UTC

Seems that I've made that out --

string DisplayTest = (nestedTable.DisplayElements[0].ParentTable as GridTable).GetTableCellStyle(rec, "ColumnName").FormattedText;

Or is there a way to reduce the (nestedTable... as GridTable) thing?

haneefm [Syncfusion]
Replied On April 9, 2007 08:57 AM UTC

Hi Helen,

Please try this code to get the display text of the cell in a nested table.

string DisplayText = this.grid.GetTable("NestedTableName").GetTableCellStyle(rec,"ColumnName").FormattedText;

Best regards,

Replied On April 10, 2007 05:42 AM UTC

Thanks a lot!

Replied On June 29, 2007 12:15 PM UTC

I tried the solution mentioned in the post to fetch displaytext of the cell, but it did not work.

It returns the value 37964.159999 which is the value from datasource.
This value is updated to display £37.9 in 'gridGroupingControl1_TableControlDrawCellDisplayText' event by setting the value e.inner.displaytext.

Please help me to get the correct displayed value

Thanks and Regards

haneefm [Syncfusion]
Replied On June 29, 2007 09:34 PM UTC

Hi Anju,

Setting the e.Inner.DisplayText using the TableControlDrawCellDisplayText event does not store the value to grid. So, there is no direct way to access this DisplayText. But one way you could have an Hashtable, which takes the key of the corresponding cell Indentity( RowIndex and ColIndex combination) as the hashkey and the associated e.Inner.DisplayText as the hashValue. You can retrieve the corresponding hashvalue anytime using the cell Indentity( RowIndex and ColIndex combination). Please try the suggestion and let me know if this helps.

Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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