BestFitColumnMode

4 posts, 0 answers
  1. Luis
    Luis avatar
    35 posts
    Member since:
    Aug 2009

    Posted 02 Jan 2019 Link to this post

    Hi.

    There is any way to mimic RadGridView.BestFitColumns(BestFitColumnMode.AllCells)?

    RadVirtualGrid.BestFitColumns() ignores cells that are not displayed or visible.

    Thanks.

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 02 Jan 2019 Link to this post

    Hello, Luis,   

    Indeed, RadVirtualGrid best-fits only the visible cells. This is intended behavior because RadVirtualGrid requests data on demand when you scroll. It doesn't know what is the invisible data until you demand it. This is the core mechanism for populating RadVirtualGrid with data because it optimizes the performance when interacting with large amounts of data.

    If you need to best-fit all cells, feel free to use RadGridViewhttps://docs.telerik.com/devtools/winforms/controls/gridview/columns/resizing-columns-programatically

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Luis
    Luis avatar
    35 posts
    Member since:
    Aug 2009

    Posted 03 Jan 2019 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess.

    Thanks for the suggestion, but I do not know if RadGridView will serve because I'm using RavenDB and I need to customize all data access operations like sorts, filters and pagination.

    Does RadGridView for WinForms support this case?

    In the past I've done something similar with Grid widget in Asp.net MVC, but in that case it was easier because I could customize almost everything on server-side code.

    In fact, I did not choose to use RadVirtualGrid for its performance enhancements, I do not even have that much data to work with, but rather because of the ease in intercepting and manipulating the data operations through the CellValueNeeded event were determining factors.
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 08 Jan 2019 Link to this post

    Hello, Luis,  
     
    RadGridView supports sorting, filtering, paging out of the box. However, when you set the DataSource property, the grid works with the whole data for achieving sorting, filtering, sorting. You need to extract the whole data and assign it as DataSource. Additional information about the data binding is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/gridview/populating-with-data/databinding-radgridview Having the whole data in the grid, the best-fitting functionality will consider all the rows when calculating the column's width.

    Unlike RadGridView, RadVirtualGrid requests data on demand and it is not necessary to extract the whole data at once. However, thus, the best-fitting functionality will handle only the requested (visible) data. 

    Both controls provide different functionality depending on the specificity of the data management they offer. Feel free to use this approach which suits your requirement best.

    Should you have further questions please let me know.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top