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
close icon

PrepareViewStyleInfo

I am coloring a databound grid in the PrepareViewStyleInfo event which works fine, however when clicking in certain cells the coloring of the cells is changed to an incorrect color. How can I stop this event from firing when a user clicks a cell, or just ignore the click event in the PrepareViewStyleInfo event? The coloring of the grid only needs to occur when it is first loaded. Regards Aaron

1 Reply

AD Administrator Syncfusion Team March 22, 2005 06:30 PM UTC

You cannot turn PrepareViewStyleInfo off on a cell by cell basis. And, you have to continually set the color in PrepareViewStyleInfo or the color will be lost the next time the cell is drawn. So, you need to track down why PrepareviewStyleInfo is getting the wrong color. If you post your handler code here, maybe we can suggest something. If the color is set on a column basis, you can set it using GridBoundColumn.StyleInfo.Color for teh column. But if it varies from cell to cell, then you will have to use PrepareViewStyleInfo in a GridDataBoundGrid.

Loader.
Live Chat Icon For mobile
Up arrow icon