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

BestFitColumnMode

3 Answers 199 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Luis
Top achievements
Rank 1
Luis asked on 02 Jan 2019, 12:15 PM

Hi.

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

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

Thanks.

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 02 Jan 2019, 02:39 PM
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.
0
Luis
Top achievements
Rank 1
answered on 03 Jan 2019, 11:28 PM
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.
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Jan 2019, 09:12 AM
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.
Tags
VirtualGrid
Asked by
Luis
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Luis
Top achievements
Rank 1
Share this question
or