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.

Getting the display text of a GridGroupingControl cell

Thread ID:

Created:

Updated:

Platform:

Replies:

59144 Apr 5,2007 10:36 AM Jun 29,2007 05:34 PM Windows Forms 7
loading
Tags: GridControl
Helen
Asked On April 5, 2007 10:36 AM

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 11:22 AM

Hi Helen,

You can try this code.

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

Best regards,
Haneef

Helen
Replied On April 6, 2007 02:59 AM

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

Helen
Replied On April 6, 2007 09:41 AM

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 04:57 AM

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,
Haneef

Helen
Replied On April 10, 2007 01:42 AM

Thanks a lot!

Anju
Replied On June 29, 2007 08:15 AM

Hi,
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
Anju




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

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,
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.

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.

;