Creating an edit row on a DataGrid

Posted on 2012-08-30
Last Modified: 2012-12-20

I am developing a ASP.NET application that displays a DataGrid for editing purposes. The DataGrid is bound to a DataSet that is associated to a SQL table via a DataAdapter. When this application is first deployed, the SQL Table will have been built but will be empty, so when the DataSet is bound to the DataGrid and the DataGrid is displayed, there will be no rows to display - only the column headers. How do I present the first blank row to the user for data entry? If there is initial data in the SQL table, I have been able to display it and have the user edit this data. I just haven't been able to figure out how to present a blank row.

Thx for any pointers/help you can provide ...
Question by:sccobber
    1 Comment
    LVL 1

    Accepted Solution

    Have you looked at the AllowUserToAddRow event of the datagrid viewer?  If I remember right, that will add a row at the bottom of the data that is fully editable and blank.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    Viewers will learn how the fundamental information of how to create a table.
    Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now