in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Override DrawRow + Setting Style

Last post 10-16-2007 6:31 AM by Wolfgang Knauf. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-15-2007 6:24 PM

    Override DrawRow + Setting Style

    I am overriding the flex grid's DrawRow method.  Within this method I:

    1.  Get a CellRange consisting of the entire row.

    2.  Set the style on this CellRange.

    3.  Call base.DrawRow.

    This seems to work except that the other controls on my dialog, buttons, a list box and a combo box no longer redraw themselves on a tab page change.  They do redraw when the dialog is resized.  If I take out line #2 above, everything draws ok.  Anybody have a clue what could be happening here?

     

    Filed under: ,
  • 10-16-2007 6:31 AM In reply to

    Re: Override DrawRow + Setting Style

    Hi Jim !

    Setting the cellstyle causes another Redraw for this cell, so that you are in an endless loop (your CPU usage should be 100%). Do NOT set or modify the cell style in a drawing operation.

    Normally you would handle owner drawing in the event "OwnerDrawCell" (set DrawMode to "DrawModeEnum.OwnerDraw" to activate it). There you can assign a custom style to the event args and call "e.DrawCell()".

     

    Hope this helps

     

    Wolfgang
     

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.