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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to retrieve the text that is set in the TableControlDrawCellDisplayText event of the GroupingGrid?

Problem

There is no direct way to retrieve the text that is set for any cell in the TableControlDrawCellDisplayText event because the GridStyleInfo object associated with the cell does not hold any information.

 

Solution

The text can be retrieved by having a hashtable with record and the column names as the hashcode key. In the following code example, a unique key for each cell is generated because the row index might be changed due to other functions. For example, Sorting. The GetKey method is used to convert the record and column names to hashcode key.

C#

VB

A column QtyPerUnit is customized by the TableControlDrawCellDisplayText event to format the cell value to Kilograms. For example, 1000 is changed to 1 Kg. These customized texts are stored into the hashtable based on its hashcode key.

C#

VB

Finally, the value of the selected records is retrieved and the customized text is recovered through the hashtable ht[GetKey(record, "QtyPerUnit")]. These changes are handled in the buttonClick event.

C#

VB

 

After applying the properties, the Grid looks like the following screenshot.

 

Sample Links

CS: Retrieving_DisplayText

VB: Retrieving_DisplayText

Article ID: Published Date: Last Revised Date: Platform: Control:
750 04/30/2011 02/12/2016 WinForms GridGroupingControl
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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