WinForms radGridView BestFitColumns suggestion

1 Answer 62 Views
GridView
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Curtis asked on 01 Dec 2023, 08:37 PM

BestFitColumns is a great way to stretch/narrow your columns based on the data they contain.

There are a few issues when using this.  My suggestion deals with one of them.

Suggestion:  When using BestFitColumns, please add a new optional Parameter called "PadWidth" or something similar.  This would be an Integer value and when the BestFitColumns executes, it will add "PadWidth" pixels to the width of the column AFTER calculating the 'Best Fit' width.

Reason:  Several Themes will accurately "squeeze" column width's so they JUST BARELY fit the Column Data. While this may be the desired output, it's rather unpleasant to look at:  The data is smashed right up against both left and right cell borders.  Additionally, some themes have a 2 or more pixel, Cell FOCUSED border (I don't know what to call it.  The 'cursor' perhaps?  The visual indicator of what Cell the user is currently on. 

Anyway, as you move this 'Cursor' if you navigate to a cell where the data was the widest, this thicket "border" takes up too much room in the cell to display the entire string, and so you're back to seeing Ellipses instead of the entire data.

By adding an Optional "PadWidth" value (I'll use 10 for example) AFTER the BestFit width has been calculated but before that is applied to all columns, the cell width will gain an additional 10 pixels.  This will allow for the extra-wide Cell "cursors" as well as allow developers to create less "cramped" grids.

 

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 06 Dec 2023, 10:56 AM

Hi Curtis,

I appreciate your feedback. I am assuming that you have set the BestFitColumns() method with BestFitColumnMode.DisplayedCells parameter. You have a point here. I will transfer your requirements to our development team. In the meantime, may I ask you to share in which theme this behavior is observed so that I can try to find to workaround for this behavior? 

Regards,
Dinko | Tech Support Engineer
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
GridView
Asked by
Curtis
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or