locked
Use Grid View For Data Entry RRS feed

  • Question

  • User-410261901 posted

    I want to have a gridview with no data source and  use it strictly for data entry.  Then bind the data to a data table when C# when a user presses the save button.

    Can a asp:gridview be used in thish format?

    Wednesday, January 31, 2018 11:24 PM

All replies

  • User475983607 posted

    I want to have a gridview with no data source and  use it strictly for data entry.  Then bind the data to a data table when C# when a user presses the save button.

    Can a asp:gridview be used in thish format?

    Sure, but it would be easier to simply create an input form.  What feature does the GridView provide over a server control like the FormView which is designed for creating input.

    Thursday, February 1, 2018 12:24 AM
  • User-410261901 posted

    HiThereItsClaire

    I want to have a gridview with no data source and  use it strictly for data entry.  Then bind the data to a data table when C# when a user presses the save button.

    Can a asp:gridview be used in thish format?

    Sure, but it would be easier to simply create an input form.  What feature does the GridView provide over a server control like the FormView which is designed for creating input.

    Hello - the link you posted does not appear to work for me?

    I only was thinking gridview as the headers would be database field names so it "should" be relatively easy to map those fields to the database, and adding rows would be very easy as well, since a gridview will auto-add.

    I'll look into a FormView - see if I can find a good tutorial on google.

    Thursday, February 1, 2018 1:09 AM
  • User-1838255255 posted

    Hi HiThereItsClaire,

    According to your description, as far as i know, it is unnecessary to use gridview as data entry, you could use table or other form as data entry, then insert the data to database directly.  For more details, please check this link: 

    Insert data in GridView without using database in ASP.Net: 

    https://www.aspsnippets.com/Articles/Insert-data-in-GridView-without-using-database-in-ASPNet.aspx 

    Best Regards,
    Eric Du 

    Thursday, February 1, 2018 4:05 AM