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

GDBG - Is there a way to dynamically change MappingName & style of cell?

I''m trying to save some screen real estate. I have a "Type" column that can be either Text or Image. Based on the chosen value, I''d like to have a second column that either shows the text (it''s rich text) or shows the image. Both the rich text and image data are in the datasource of the grid. Thanks in advance!

1 Reply

AD Administrator Syncfusion Team June 7, 2004 01:14 AM

One way to do this is to handle either PrepareViewStyleInfo of Model.QueryCellInfo. In your handler, check e.RowIndex and e.ColIndex and whatever else you have to check to decide what to show. Then set the properties of e.Style acordingly. For text, you could set e.Style.CellType = "TextBox" and set e.Style.Text to the value you want to see. For Image, you might have this set as the default for the column so youwould not have to do anything in the event to just show an image cell.

Loader.
Live Chat Icon For mobile
Up arrow icon