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

[Solved] Updating button text in a GridView row issue

2 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joseph
Top achievements
Rank 1
Joseph asked on 25 Jul 2011, 11:06 AM
Hi guys,

I have a gridview with ScrollMode set to deferred and it contains multiple columns including a custom column containing a Button.

Now when I click the button, I change its text to something else. When I scroll down I see other buttons gets updated too ?

Are these same button instances ? weird lol .

How can overcome this issue ?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 25 Jul 2011, 11:14 AM
Hi Joseph,

Generally, the virtualization of the RadGridView is turned on by default, which means that the visual elements are recycled and reused. Consequently, if you work with those visual elements and their content for example, on scrolling the same content might be set to another element. The recommended approach is to work with the underlying data item. So, you may expose a property, bind it to the content of the button and update that your custom property. 

Greetings,
Maya
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!

0
Joseph
Top achievements
Rank 1
answered on 25 Jul 2011, 11:26 AM
Hi Maya,

Thanks for the heads up !

king regards.
Tags
GridView
Asked by
Joseph
Top achievements
Rank 1
Answers by
Maya
Telerik team
Joseph
Top achievements
Rank 1
Share this question
or