Home Forums WinForms controls Xceed Grid for WinForms Row height for custom CellViewerManager

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16776 |

     

    I couldn’t find an answer to this question so please forgive me if it has already been addressed. I am using a GridControl as a custom CellViewerManager within a DetailGrid. I want the row height of the DetailGrid to be exactly large enough to display all of the largest CellViewerManager in the row. I tried setting the AutoHeightMode property, like so:

    <code>

                protected override void SetControlValueCore( Cell pDataCell )
                {
                    pDataCell.ParentRow.AutoHeightMode = AutoHeightMode.AllContent;

                    // code setting actual cell value omitted 
                }

    </code>

    But this cuts off the last couple of rows in the GridControl of the custom CellViewerManager, for reasons that are obscure to me. What’s the best way to do this?

     

    Best regards,

    Aaron Haspel

     

    Imported from legacy forums. Posted by Aaron (had 1891 views)

    User (Old forums)
    Member
    Post count: 23064

    Have you tried using the QueryFittedHeight event on the CellViewerManager?

    Imported from legacy forums. Posted by André (had 201 views)

    User (Old forums)
    Member
    Post count: 23064

    My understanding was that QueryFittedWidth applied to CellEditors, not CellViewers. However, I can get the behavior I want by calculating the height of the row inside SetControlValueCore and then setting the parent row height, i.e.:

    <code>

                protected override void SetControlValueCore( Cell pDataCell )
                {

                    // calculate the height

                    // if the height is larger than the current height, set it

                    if ( height > pDataCell.ParentRow.Height )
                         pDataCell.ParentRow.Height = height;
                }

    </code>

    But if you know of a more efficient or more elegant method I will be very happy to use it.

    Aaron

    Imported from legacy forums. Posted by Aaron (had 2472 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.