My grid view task missing auto format and edit template ?

August1x3 0 Reputation points
2023-04-13T10:43:34.5666667+00:00

Hi everybody! Can anyone tell me how could i do to display the autoformat and edit templates in design in webform. I use Visual Studio 2022 and also i can not drag and drop these grid view in the center :( It is my GridView task.User's image

User's image

This is Gridview task i want .

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,448 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,020 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,606 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,813 questions
ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
326 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Albert Kallal 5,246 Reputation points
    2023-04-22T18:08:05.0266667+00:00

    Ok, to get those "long time" options, you need to change your settings. Tools->options->Web forms designer. on general tab, you need to choose "Legacy Web Forms Designer" this option: User's image

    After you make the above, then close the project. (actaully, I would consider closing Visual studio). Now, re-launch, and re-load your project. You see then see the older options like this: User's image

    However, if you have the "new" live preview feature (introduced in vs2022 for web forms!!!), then you will see as you have and thus this: User's image

    So, switch your web forms desinger settings back to "legacy". to be fair, I tend to not use edit templates anymore. And to be fair, I tend to not use the formatting options, since you can get a "near perfect" laid out grid by adding a bootstrap class to the gridview. That simple setting will get you nice gridlines, nice hover effect, and VERY nice spacing, and makes the gridview "responsive", and all is done without having to mess with formatting. The CssClass settings I use thus are CssClass="table table-hover" And if you want alternating rows, then add table-striped to above. so, say this gridview:

                <asp:GridView ID="GridView1" runat="server" 
                    Width="50%">
            </asp:GridView>
    
    

    I then get see/this: User's image

    but, if I add the bootstrap class (this is included by default in web templates), then I get this: so, now this:

                <asp:GridView ID="GridView1" runat="server"
                    Width="50%" CssClass="table table-hover table-striped">
                </asp:GridView>
    
    

    And we now get this: User's image

    So, above results in a nice VERY good looking grid - and I don't care, or mess with the older formatting options. Regardless, to address your issue, do change the designer settings as per above in tools - you should get + see your older options.

    1 person found this answer helpful.

  2. Jiale Xue - MSFT 44,066 Reputation points Microsoft Vendor
    2023-04-13T12:44:04.0466667+00:00

    Hi , Welcome to Microsoft Q&A. After my test, you only need to select or create a data source in the choose data source option to display the options you want.

    4-13

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.