Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
95
EditorComponent property is being cleared on column with custom GlyphInfoBase
posted

Hello,

I have a column bound to Boolean data, and instead of showing a checkbox control in each cell, I want to show an image for true and no image for false. I am doing this in the context of a re-usable component (I'll call it the "grid host") that can add columns to the grid at run-time.

I am attempting to achieve this by using an UltraCheckEditor and my own GlyphInfoBase class whenever the grid host adds a bound Boolean column to the grid. In the handler for the InitializeLayout event of the grid, I do the following for this special column.

  • Get a reference to the bound column in the grid.
  • Set the caption.
  • Create a new UltraCheckEditor.
    • Set its GlyphInfo property to a new instance of my custom GlyphInfoBase.
  • Set the column's EditorComponent property to the new UltraCheckEditor.
  • Set some other properties of the column.

The result is that I'm still getting checkboxes in this column instead of my image. Also, when I set a breakpoint in the Click event handler, I found that the EditorComponent property on the column is now null.

However, if I move the section of code that creates the UltraCheckEditor so that it executes in response to the InitializeRow event instead of InitializeLayout, my image shows up correctly. This doesn't seem like the correct solution though.

So, am I attaching to the wrong event for creating my UltraCheckEditors, or am I doing something else wrong?

I've left out a lot of details in an attempt to be brief. I can provide more detail if necessary.

Parents Reply Children
No Data