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

strange behaviour in grid view

1 Answer 22 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sameh
Top achievements
Rank 1
Sameh asked on 25 Apr 2011, 10:33 PM
Hi,
I have strange behaviour in telerik gridview
it was working great in the 2010 Q3 version but when i upgraded the project to 2011 Q1 i faced the problem
the issue is:
I have a gridview with two columns one contains a checkbox and the other contains a label and in the OnRowLoaded event i wrote a code to disable the checkbox in some cases of the current row, and it was working correctly in the previous version and when i upgraded to the current version i noticed that the grid is first loading as expected but when i scroll the grid another checkbox is disabled (it seems that the event is fired again) and again in each scroll (up or down) another checkbox is disabled.
after a lot of trying i set the property EnableRowVirtualization=False then the grid is worked correctly but i became very slow.

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Apr 2011, 08:26 AM
Hi Sameh,

Generally, when the virtualization is turned on (as it is by default), the visual elements will be recycled and then reused again. Consequently, you may get the behavior you experience - that some CheckBox-es are checked/unchecked upon scrolling. However, this will be observed only if no property from your business object is exposed as a data binding. So, I would suggest you to expose a boolean property and bind it to your GridViewCheckBoxColumn by DataMemberBinding. If you want to enable/disable some of those check boxes, I would recommend you to use the IsReadOnlyBinding as illustrated in this article

Greetings,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Sameh
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or