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
890
Cell spanning and horizontal scrolling redraw issue
posted

Hi All,

I've implemented cell spanning as per the Infragistics KB article:

http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7325

But I've noted that the spanned cell does not redraw correctly when using the horizontal scrollbar.  Steps to reproduce:

Open the project in the KB article (I used the VB one).

Set the grid to Dock = Full. 

Run the project. 

Resize the form so use of the horizontal scrollbar is necessary.  You should see that the spanned cells do not redraw correctly.

Can someone please advise on how I can fix this redraw issue?

Thanks,

Scott

  • 469350
    Suggested Answer
    Offline posted

    Hi Scott,

    To be perfectly frank with you, I took a look at the sample and there are quite a number of problems with it. It looks like it was written a very long time ago (back in 2005) and it's really out-dated.

    The sample is using the UIElement from the first cell and extended it into the second cell. This is a bad idea, because if the first cell is scrolled completely out of view, then there will be no UIElement created for that cell and the second cell will just show an empty space.

    Also, when you scroll, it looks like the grid is only invalidating the area where it thinks the cell is.. it doesn't know that the UIElement was moved.

    If you want to span cells like this, there's a better way. What I would do is use a RowLayout. What you do is create an unbound column and set it up so that the unbound column spans the same logical position as the two bound columns.

    Then, in the InitializeRow event of the grid, you hide either the the two real cells or the unbound cell so that only one or the other shows up.And, of course, you populate the unbound cell with the value from the first bound cell.

    None of this accounts for what happens if the user decides to move one of the column, of course. :)