Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS Designer still does not add name property in designer.cs file for ListView ColumnHeader Types #12178

Closed
Howard0101 opened this issue Sep 19, 2024 · 3 comments
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues
Milestone

Comments

@Howard0101
Copy link

Howard0101 commented Sep 19, 2024

Environment

Microsoft Visual Studio Enterprise 2022 (64-bit) - Current
Version 17.11.4

.NET version

NET 8

Did this work in a previous version of Visual Studio and/or previous .NET release?

I honestly do not know

Issue description

The ListView Columns IndexOfKey function ALWAYS returns -1 (=not found). Eventhough the column name is correct and set in the VS Designer.

Steps to reproduce

Using NET 8 Windows Forms and creating a Windows Form with Visual Studio Designer which contains a ListView Control listView, I added some ColumnHeaders with Name (example "aCreatedHeader") and Text (example "Header") Properties. In the code behind try to use the function listView.Columns.IndexOfKey("aCreatedHeader"). It will ALWAYS return -1 since the deisgner neglets to write the name Property in the corresponding designer.cs file.

Please reopen closed Ticket #2867 or #2869 .

Diagnostics

No response

@Howard0101 Howard0101 added the untriaged The team needs to look at this issue in the next triage label Sep 19, 2024
@merriemcgaw merriemcgaw added the area-VSDesigner Windows Forms out-of-proc designer related issues label Sep 19, 2024
@merriemcgaw
Copy link
Member

@Olina-Zhang can your team regress this and let us know if we've ever done this differently for Framework or Core versions? Thanks!

@Zheng-Li01
Copy link
Member

Zheng-Li01 commented Sep 20, 2024

@merriemcgaw, the issue still can reproduce from .NET Core 3.1 to .NET 9.0, and also no below code section generated in the Form1.Designer.cs file between Dev17 17.11.4 and latest Dev17 main versions.

And the issue also can reproduce on .NET Framework project which have the same behavior with .NET project.

columnHeader1.Name = "columnHeader1";
columnHeader2.Name = "columnHeader2";

image

@JeremyKuhne JeremyKuhne modified the milestones: .NET 10.0, VS release Sep 24, 2024
@JeremyKuhne JeremyKuhne removed the untriaged The team needs to look at this issue in the next triage label Sep 24, 2024
@Tanya-Solyanik
Copy link
Member

A simple fix we tried in the past had introduced regression, given that this behavior existed in .NET Framework , it does not meet the bar at this point

@Tanya-Solyanik Tanya-Solyanik removed their assignment Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues
Projects
None yet
Development

No branches or pull requests

5 participants