High Performance RadGridView - Manually Generate Columns

3 posts, 0 answers
  1. Paul
    Paul avatar
    35 posts
    Member since:
    Aug 2015

    Posted 06 Dec 2016 Link to this post

    I downloaded the VirtualRadGridView example from here and am setting the VirtualDataSource to a DynamicList class I created that provides records via Load-On-Demand. The DynamicList is a generic list. The VirtualRadGridView is auto generating columns based on properties from the generic type of the DynamicList, even if I set AutoGenerateColumns = false. In the constructor for the RadForm, I'm creating the VirtualRadGridView, clearing the columns, and adding one column. But when the RadForm displays the Grid, it shows the auto-generated columns without the column I added. I found that when the VirtualRadGridView is Initialized, the method InitializeColumns() is called which enumerates all the ItemsSource.BoundProperties and replaces columns starting at index 0. I'm assuming I should insert an if statement to check if AutoGenerateColumns = false and return if so in the InitializeColumns(), but am unsure and wondering if there was a reason the method was designed the way it is or if this was just a simple overlook.
  2. Paul
    Paul avatar
    35 posts
    Member since:
    Aug 2015

    Posted 06 Dec 2016 in reply to Paul Link to this post

    I went ahead and tried returning within the InitializeColumns() method if AutoGenerateColumns = false, but this didn't work correctly. It didn't auto-generate columns and my manually added column was displayed, but the values loaded were based off VirtualRadGridView.ItemsSource.BoundProperties. I'm unable to determine how BoundProperties is being initialized. BoundProperties is being loaded with four ReflectPropertyDescriptor records related to properties of the DynamicList class's generic type. I need BoundProperties to contain ReflectPropertyDescriptor records for the properties of the DynamicList class's generic type based on the Manually added columns' FieldName properties.
  3. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4080 posts

    Posted 07 Dec 2016 Link to this post

    Hello Paul,

    Thank you for writing.  

    I would recommend you to use RadVirtualGrid which is a grid component developed on top of Telerik Presentation Framework which provides a convenient way to implement your own data management operations and optimizes the performance when interacting with large amounts of data. You can specify how many columns and rows to be displayed in the grid. The CellValueNeeded event is fired once a cell value is requested. Additional information about populating with data is available here: http://docs.telerik.com/devtools/winforms/virtualgrid/working-with-data/virtualgrid-populating-with-data

    Our Demo application >> VirtualGrid examples demonstrate different functionalities that RadVirtualGrid supports.

    I hope this information helps. Should you have further questions I would be glad to help.

    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
Back to Top