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 |
Article ID: | Published Date: | Last Revised Date: | Platform: | Control: |
750 | 04/30/2011 | 02/12/2016 | WinForms | GridGroupingControl |
Tags:
|
or the page will be automatically redirected to sign-in page in 10 seconds.