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. Image for the cookie policy date

Altering data displayed

I''ve got a GridDataBoundGrid with its DataSource set to a custom collection and using GridBoundColumn''s to map properties of the objects in the collection to columns in the grid. I want to alter the way a particular column is displayed. The column is bound to a numeric property, and I want to do some processing with that number and actually display text I provide in the column instead of the number. Modifying the class for the objects in the collection to provide a property for the text I want is not a possibility. I looked at the Grid.DrawCellDisplayText event. I can get the text about to be displayed in the cell and can change it by setting e.DisplayText, but I can''t figure out how to tell what column is being displayed so I don''t know whether or not to modify the text. I looked at the Grid.DrawCell event. I can get the Column/Row index for the cell being drawn (e.ColIndex and e.RowIndex), and can probably use that to get to a particular object in the collection to get the value of the numeric property in question, but I can''t figure out how to change the text displayed. Can anyone provide any suggestions or solutions, or just a point in the right direction? Thanks! ----- Lee

1 Reply

AD Administrator Syncfusion Team July 6, 2004 12:24 PM

In DrawCellDisplayText, maybe you can check e.Style.CellIdentity.Colindex to find out where you are? Or, you might try handling grid.Model.QueryFormattedText and format things there.

Loader.
Live Chat Icon For mobile
Up arrow icon