Manually insert rows

3 posts, 1 answers
  1. Christian
    Christian avatar
    17 posts
    Member since:
    May 2016

    Posted 28 Jul Link to this post

    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. Answer
    Dimitar
    Admin
    Dimitar avatar
    1410 posts

    Posted 28 Jul Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Christian
    Christian avatar
    17 posts
    Member since:
    May 2016

    Posted 28 Jul Link to this post

    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
Back to Top