davidegironi / advanceddatagridview

A .NET WinForms DataGridView with advanced capabilities
392 stars 123 forks source link

Column Header Size Issue with ADGV created in previous version. #131

Closed ccordero44 closed 7 months ago

ccordero44 commented 8 months ago

Hello. I updated ADGV using Nuget Package Manager and it's causing my column headers for ADGV created in the previous version to increase in size and won't allow me to revert the headers to the previous sizes.

davidegironi commented 8 months ago

Thank you for your submission. Indeed the previous update has something related to column height. Can you please attach some screenshot. It also maybe something related to custom fonts. Also how do you instantiate and setup this component?

MattH-Work commented 8 months ago

I'm having a similar issue Just upgraded to the latest build ( 1.2.29016.12 ), not changed any code

Notice the 3 different drop down size, 2 different AdvancedDataGridViews image image

Here we have different sizes in the same ADGV image

ccordero44 commented 8 months ago

Yes this is exactly the issue I’m having. Sorry I haven’t had a chance to post screenshots.

On Tuesday, March 5, 2024, MattH-Work @.***> wrote:

I having s simialr issue Just upgraded to the latest build ( 1.2.29016.12 ), not changed any code

Notice the 3 different drop down size, 2 different AdvancedDataGridViews image.png (view on web) https://github.com/davidegironi/advanceddatagridview/assets/84494183/9b7f91b9-9cd7-4d89-b54c-8dd9e137f8f3 image.png (view on web) https://github.com/davidegironi/advanceddatagridview/assets/84494183/7effa472-c2a0-4f0c-8528-74da1f80ce71

Here we have different sizes in the same ADGV image.png (view on web) https://github.com/davidegironi/advanceddatagridview/assets/84494183/911cea06-3320-4cba-b4cf-29733a5c94b0

— Reply to this email directly, view it on GitHub https://github.com/davidegironi/advanceddatagridview/issues/131#issuecomment-1978630862, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJJ7ERDFPTJ322Z2V7JERETYWWZOTAVCNFSM6AAAAABDYUCAVWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZYGYZTAOBWGI . You are receiving this because you authored the thread.Message ID: @.***>

--

Sincerely,

Carlos Cordero m: (630) 461-7785 e: @.***

davidegironi commented 8 months ago

Now i see. I think it's something related to the way column appearance. Can you please share your settings, or better reproduce it in a sample project?

peros550 commented 8 months ago

Also same issue here on a .net v4.8 application right after downloading latest version. Loading code of datagridview does not have anythig special.

davidegironi commented 8 months ago

I know where the problem lies but I'm not able to reproduce. Can you please share your settings, or better reproduce it in a sample project?

ccordero44 commented 8 months ago

I’m not able to reproduce with a new ADGV either. It seems to only effect ADGV created with the previous release. On Mar 7, 2024, at 5:16 AM, Davide Gironi @.***> wrote: I know where the problem lies but I'm not able to reproduce. Can you please share your settings, or better reproduce it in a sample project?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

davidegironi commented 8 months ago

So, can you create something with the previous release, then switch to the new one to check it has errors? Please understand that without being able to reproduce this error it's difficult for me to solve this :(

davidegironi commented 7 months ago

I was able to reproduce it. Can you please test the attached code? https://file.io/5zd7TFzOIAOE A couple of detectors for the max header height has been added. One can still increase the maximum amount of height for the image using the MaxFilterButtonImageHeight setting.

will-scc commented 7 months ago

I was able to reproduce it. Can you please test the attached code? https://file.io/5zd7TFzOIAOE A couple of detectors for the max header height has been added. One can still increase the maximum amount of height for the image using the MaxFilterButtonImageHeight setting.

Hi Davide,

I have tested and can confirm those changes seem to work as expected now.

Current version (100% scaling): image

New version (100% scaling): image

Current version (125% scaling): image

New version (125% scaling): image

davidegironi commented 7 months ago

Thanks! Within a couple of days I'll post a new release and close this issue.

davidegironi commented 7 months ago

Updated version with fix.

MattH-Work commented 7 months ago

Left image is the drop down from the latest build Right image is from a previous build ( -2 )

image

Note that the original ( right ) drop down is 16x16, the new ( left ) drop down is 18x18 which seems to cause 'fuzzy' scaling of the icon

davidegironi commented 7 months ago

Thanks for this feedback. So, it's due to the way the new image size is computed. It's now 0.8 time smaller then the max image dimensions, to allow spacing for top and down borders. Anyway, can you please download the code and try this. Change line 40 of ColumnHeaderCell.cs from this public const int FilterButtonImageDefaultSize = 23; to that public const int FilterButtonImageDefaultSize = 20; That way filter size should be 16x16. If that fix the issue, I'll post this fix soon.

MattH-Work commented 7 months ago

Unfortunately, didn't work. Icon is still 18x18

image

davidegironi commented 7 months ago

It does not work cause the MaxFilterButtonImageHeight value is overridden by the FilterButtonImageDefaultSize if it's lower than that value. So you have to recompile one project with FilterButtonImageDefaultSize set to 20

        /// <summary>
        /// Get or Set the max filter button image height
        /// </summary>
        public int MaxFilterButtonImageHeight
        {
            get
            {
                return _maxFilterButtonImageHeight;
            }
            set
            {
                _maxFilterButtonImageHeight = value > ColumnHeaderCell.FilterButtonImageDefaultSize ? value : ColumnHeaderCell.FilterButtonImageDefaultSize;
            }
        }