Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7576387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T16:54:28+00:00 2026-05-30T16:54:28+00:00

I’m trying to allow my users to enter in large lists of data using

  • 0

I’m trying to allow my users to enter in large lists of data using an ASP.Net GridView control. The affect I’m trying to create is to make the GridView control act like a spreadsheet. The user can freely enter data and tab from column to column and row to row. The user can use a button at the bottom of the page to add rows as needed. There is also a button at the bottom of the form to save as needed.

To do this, I created a DataTable with a bunch of empty rows and bound it to a GridView. The GridView’s columns are template columns that contain textboxes. So, when the page opens, it actually looks like a spread sheet. When the user hits the add rows button, I just add another ten rows to the DataTable the GridView is bound to and it works like a charm.

The issue I’m running into is reading the data that the user entered. When the user hits the paging link or the update button, I would like to update the DataTable with the data the user typed in. Here is what I have.

Private Sub UpdateDataTable()
    Dim objCatRow As clsCategoriesRow = Session("gvCategoriesRow")
    Dim drQuery() As DataRow = Nothing
    Dim drRow As DataRow = Nothing
    Dim objRow As GridViewRow = Nothing
    Dim intRecNo As Integer = 0
    Dim txt As TextBox = Nothing
    Dim lbl As Label = Nothing

    'Loop through all of the rows in the grid view control
    For Each objRow In Me.gvCategories.Rows
        'Get the label that contains the identity column
        lbl = objRow.Cells(GridColumns.Category).FindControl("lblItemRecNo")
        intRecNo = lbl.Text

        'Update the datarow bound to this grid view row
        'First, query the datarow from the data table
        drQuery = objCatRow.Table.Select("recno = " & intRecNo)
        'Make sure our query returned a row
        If Not IsNothing(drQuery) AndAlso drQuery.Count > 0 Then

            'Get the value from the textbox in the grid view
            txt = objRow.Cells(GridColumns.Category).FindControl("txtItemCategory")
            'Upadte the data row with the value the user entered
            'THE VALUE IN txt.Text IS EMPTY. HOW CAN I GET THE VALUE THE USER TYPED IN?

            drQuery(0)("Category") = txt.Text
            'Get the value from the textbox in the grid view
            txt = objRow.Cells(GridColumns.SortORder).FindControl("txtItemSortOrder")
            'Upadte the data row with the value the user entered
            drQuery(0)("sortorder") = txt.Text
        End If
    Next

End Sub

The issue is that this is not returning what the user typed in. The line

txt = objRow.Cells(GridColumns.Category).FindControl(“txtItemCategory”)

returns a reference to the textbox in the templated column. But, it contains the previous value, the value from the view state, not the value the user typed in.

How can I get the value the user typed into the grid?

I want to mention that I know how to add EDIT and UPDATE buttons to each row. I would like to avoid doing that way if I can. My users have huge lists of data to enter in and that approach would make the application unusable.

Thanks in advance,

Mike

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T16:54:29+00:00Added an answer on May 30, 2026 at 4:54 pm

    The form data posted by the user is found in the Page.Request.Form.Item collection. The Page.Request.Form.AllKeys lists the “keys” associated with all of the form item values.

    If Page.Request.Form.HasKeys Then
    For Each key as String In Page.Request.Form.AllKeys
    ' step through the keys and use Page.Request.Form.Item(key) to get the data entered
    Next
    end If
    

    After testing, I was able to get the data from the Request.Form data or the GridView control during page.load on postback, as long as you don’t bind the control on postback, but only during the initial request (“GET”).

    Keep in mind, controls have to be re-created for each request to the page. The Request data posted is used by ASP.NET to repopulate form data controls only after the controls are re-created on the page and the ViewState for the controls is processed, etc.

    Request.Form collection
    ASP.NET Page Life Cycle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.