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

Manually insert rows

2 Answers 73 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Christian
Top achievements
Rank 1
Christian asked on 28 Jul 2016, 09:10 AM

Hi,

I am using code based on the project found here: http://www.telerik.com/forums/charts-inside-gridview-cells-problems-during-the-scrolling. It works for the most part, but SetContentCore gets called repeatedly and for whatever reasons. I'd like to manually add rows to the grid and disable the autogeneration of new rows on scrolling. For some reason this behaviour causes bugs on my end like duplicating rows multiple times, although the bindinglist passed to it as datasource doesn't contain duplicates. Note the sample project provided in the reference works just fine, so I couldn't reproduce the error.

BR

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 28 Jul 2016, 11:34 AM
Hi Christian,

Thank you for writing.

RadGridView is using UI Virtualization. This means that the RowElements (the actual row visual part) are created only for the currently visible rows. When you are scrolling these elements are reused and only their value is changed (at this point the SetContentCore method is called and this allows you to updated the current cell value). This functionality cannot be disabled and you cannot add row elements manually. I would advise you to check your code carefully and make sure that the chart is properly updated in the SetContentCore method (clear all series and add new ones). In addition, make sure that the IsCompatible method is overridden as well. If you cannot determine what is causing this behavior consider opening a support thread where you can attach your project. This will allow us to examine your exact case and provide you with a solution. 

I hope this will be useful. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Christian
Top achievements
Rank 1
answered on 28 Jul 2016, 11:41 AM

Hi Dimitar,

thank you for your quick answer. This explains a lot and fixes my problems. I am now treating SetContentCore as a way to recycle rows.

BR
Tags
GridView
Asked by
Christian
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Christian
Top achievements
Rank 1
Share this question
or