DataGridView columns auto resize after column captions localization

0
0

Dear Team,

I have a DataGridView with columns with set to autosize according to each column caption text length. Please see the image attached.

I need after language change all columns to resize according to new language captions length.

If I do manually resize one column, all columns autoresize according to their new caption texts lengths. But I can not do it programmatically after each language change procedure.

Please help.

Best whishes!

Attachment
  • You must to post comments
0
0

Hi, Luca,

I do not switch culture in Default.json.

I have my own runtime localization model in which I just change column headers text in runtime mode after klick on different language button.

It is funny because if I reload the grid content columns headers widths adjust to columns headers text.

Should I each time add and delete one row in the grids just to adjust column headers width or there is more elegant way?

 

  • Frank (ITG)
    Hi, if you come up with a stripped down compilable test case showing the way you handle the localization we might come up with some optimization for the autosizing. Best regards Frank
  • You must to post comments
0
0

I test with 3.1.10 in a localizable window, set the Column1 header text to “Column 1” in “en-US” then tp “Colonna Uno” in “it-IT”, set the initial Width to 50. Switched the culture in Default.json and it seems to work well using AutoSizeColumnsMode = AllCells and ColumnHeader. I also tried changing the header text after creation (automatic localization can only be set when a control is created) and it still works.

If you can attach a small test case we can try to reproduce.

 

  • You must to post comments
0
0

Thank you!

I now work with the latest version but the problem still exist, as I describe in my edited post above:

I have a DataGridView with columns with set to autosize according to each column caption text length. Please see the image attached.

I need after language change all columns to resize according to new language captions length.

If I do manually resize one column, all columns autoresize according to their new caption texts lengths. But I can not do it programmatically after each language change procedure.

  • You must to post comments
0
0

I managed to migrate to version 3.2.0.28.

But the problem still exist. If I change the language and column captions accordingly the columns do not resize. If I click on one of the columns all columns immediately resize.

Attachment
  • Alaa (ITG)
    Hi, you have to update your version from the NuGet package manager in Visual Studio (change source to nuget.org). The VSIX is only for the designer.
  • mgmst
    • mgmst
    • Apr 18, 2023 - 7:11 pm
    Thank you! I managed to do that but the problem still exist, as I describe in my edited post above.
  • You must to post comments
0
0

Thank you!

Where to find this 3.1.10 preview version?

  • You must to post comments
0
0

Hi there,

Could you please try with the latest 3.1.10 preview build and see if it’s fixed on your end?

A fix for a similar issue is included in it!

Best,
Alaa

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.