Winforms: An error dialog pop-up when edit the DefaultCellStyle property in DataGridView control

Created on 8 Apr 2020  Â·  16Comments  Â·  Source: dotnet/winforms

.NET Core Version:

5.0.100-preview.4.20202.8

Have you experienced this same bug with .NET Framework?:

No

Problem description:
When edit the cell style properties for a DataGridView control in PropertyGrid, an error dialog pop-up.
5 0

More info:

  1. This issue occurs in all cell style properties: AlternatingRowsDefaultCellStyle, ColumnHeadersDefaultCellStyle, DefaultCellStyle, RowHeadersDefaultCellStyle and RowDefaultCellStyle.
  2. If target .NET Core project to 3.1, these proprties are grey and cannot edit.
    3 1

Expected behavior:

The CellStyle Builder dialog should be opened.
Framework

Minimal repro:

  1. Launch the attached project in VS and run it.
  2. Click the … edit button for AlternatingRowsDefaultCellStyle property in PropertyGrid.
    Core5.0-TestApp.zip
designer support tenet-compatibility

Most helpful comment

@dreddy-work I have retested this issue with latest main VS 2019 + latest .NET 5.0.100-rtm.20518.2 SDK, all the cell style property dialogs can be opened correctly in Properties window whether targeting project to .NET Core 3.1 or .NET 5.0. But the cell style property dialog still cannot be opened from PropertyGrid when running project. Please check the below gif files:

  1. When targeting project to .NET Core 3.1 and running it, all the cell style properties are grey and cannot edit in PropertyGrid.
    TestApp-Core3.1.zip
    TestResult-3 1

  2. When targeting project to .NET 5.0 and running it, then try to edit the cell style properties in PropertyGrid, the initial error dialog will pop-up.
    TestApp-Core5.0.zip
    TestResult-5 0

All 16 comments

@dreddy-work - do you need these ASAP for your DGV work?

Might be related to #1115

ping @dreddy-work :)

In 16.7 Preview 5 with .NET Core 3.1 target. All style dialogs opening correctly, but produce no code - no changes.

@John-Qiao can you check to see if this is already fixed, and if so, close?

@merriemcgaw Verified the issue in Dev16 16.8.0 Preview 4.0 [30507.17.main] + .NET 6.0.100-alpha.1.20455.1, this issue still can be reproduced, please check below screenshot:
DGV-PropertyGrid

V.S. 16.8 pr. 3.

  • With netcoreapp3.1 target: all as was before - all style dialogues opening correctly, but produce no code - no changes. Corresponding issue.
  • With net5.0-windows target (Version: 5.0.100-rc.2.20465.34 Commit: 7e7de71fc4): the designer not working at all - not show any control properties. Corresponding issue.

Thanks @kirsan31 , I'm following up on these two issues personally. The 5.0 SDK one is particularly worrisome as we're in the very end of the 5.0 ballgame. We'll keep you posted. Thank you so much for filing the Developer Community issues, by the way! It makes diagnostics easier by far. We'll reach out if we need any more info from you about the issues. Thanks again!

I tested with the public release of 16.8p3 and the latest build of .NET Core (one later than yours I think). The designer is not blocked, we can see properties now for controls that are selected. For the DataGridView dialogs, we're working on getting them updated as part of another effort, and the result of that effort is expected to resolve the issues with not writing code changes to the file. You should see a fix in 16.8p4 (can't make promises but that's the current plan).

@John-Qiao , can you try this, one more time with final version of Preview4?

@dreddy-work I've checked.

  • Changing styles works and produce code with both netcoreapp3.1 and net5.0-windows. That's cool.
  • All this old bugs, are still present.
  • undo not working or working bad:
    vsd1
    vsd2

Undo/Redo is something that is still in works for core designer. Can you create a new bug for that to track and close this issue to avoid confusion/ambiguity? We have a bug in the designer repo to track undo/redo but this repo is not public. So, new bug will be tracking purpose only.

@dreddy-work I have retested this issue with latest main VS 2019 + latest .NET 5.0.100-rtm.20518.2 SDK, all the cell style property dialogs can be opened correctly in Properties window whether targeting project to .NET Core 3.1 or .NET 5.0. But the cell style property dialog still cannot be opened from PropertyGrid when running project. Please check the below gif files:

  1. When targeting project to .NET Core 3.1 and running it, all the cell style properties are grey and cannot edit in PropertyGrid.
    TestApp-Core3.1.zip
    TestResult-3 1

  2. When targeting project to .NET 5.0 and running it, then try to edit the cell style properties in PropertyGrid, the initial error dialog will pop-up.
    TestApp-Core5.0.zip
    TestResult-5 0

OmG. I think it's my personal failure - I confused everyone in this thread :( I just once again read original issue and understand that all of this was about runtime - not designer! Sorry :worried:
Can confirm all @John-Qiao said above, this is runtime regression:

  • net5.0-windows - error.
  • netcoreapp3.1 - gray out.
  • net472 - works as expected.

I think labels must be corrected for this issue (see above)? /cc @RussKie

I think labels must be corrected for this issue (see above)?

Why?
Are you sure you're not confusing https://github.com/dotnet/winforms/labels/area%3A%20designer%20support and https://github.com/dotnet/winforms/labels/area%3A%20VS%20designer?

I think labels must be corrected for this issue (see above)?

Why?
Are you sure you're not confusing https://github.com/dotnet/winforms/labels/area%3A%20designer%20support and https://github.com/dotnet/winforms/labels/area%3A%20VS%20designer?

Indeed - my bad, sorry.

Was this page helpful?
0 / 5 - 0 ratings