This is a migrated thread and some comments may be shown as answers.

CreateCell Event

1 Answer 125 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Svein Thomas
Top achievements
Rank 1
Svein Thomas asked on 20 Jul 2011, 03:05 PM
Hi, 
I've been following the examples of this thread : http://www.telerik.com/community/forums/winforms/gridview/show-mulitple-images-in-a-gridview-column.aspx

This works fine, if the grid is painted only once. But if i scroll or change rows, the CreateCell event runs.
Also the scrolling make the buttons appear in cells that it should not appear in. I think this have something to do with the reuse of the cells in some way..

In my CreateCell i create an event for the button (like shown in the attached thread). BUt with the CreateCell going crazy all the time, this event is created a lot of times.. how can i avoid this?

Regards
SVein Thomas

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 25 Jul 2011, 02:03 PM
Hello Svein,

Thank you for writing.

The described undesired behaviour is most probably a result of RadGridView UI virtualization. This means that RadGridView reuses its visual cell elements on scrolling, if they are compatible. To specify your custom cell should be used only for one specific column, you have to override IsCompatible method. More on this technique you can find in the following article in our product documentation: Creating custom cells.

All the best,
Martin Vasilev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
Svein Thomas
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or