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 4252910
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:52:40+00:00 2026-05-21T04:52:40+00:00

I have a GridView in my page but I am NOT adding my row

  • 0

I have a GridView in my page but I am NOT adding my row through GV. Adding thru textboxes and then displaying it to the GV. Now the problem is that, when I hit ADD button my GV is not showing that updated row. If I click that page on my menu bar, then my whole page refreshes and I can see my updated GV.

Here is the mock up of my ADD_Click() event:

    protected void btnAdd_Click(object sender, EventArgs e)
    {
                        var td = from s in cv.Test1
                                 join r in dt.Test2 on s.ID equals r.ID
                                 where s.Col1 == ColumnName
                                 select s;

                        gvShowComm.DataSource = td;
                        gvShowComm.DataBind();

                    }

                    catch (Exception err)
                    {
                        //Nothing!!!
                    }
            }

            else
            {
                MessageBox.Show("Please Enter Entry for the textboxes!");
            }
        }

Now when I am adding the records, GridView is not showing the updated record. Can anyone tell me whats going on?

Thanks!

  • 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-21T04:52:41+00:00Added an answer on May 21, 2026 at 4:52 am

    First thing you should verify is that your td object has the correct amount of rows you are expecting. The GridView should be binding correctly to that object so my hunch is your result in td is missing the row.

    How are you ‘adding’ the row? Are you saving it to the DB first and then running your linq call? From the above code it just looks like your calling some linq to fetch a result but there is nothing showing you adding anything that would cause the result to be different that the initial load.

    You add pseudo code should be like:

    1. Save the new row to the database
    2. Fetch the new data
    3. Bind the new data to the grid

    You could also do it manually by fetching the old data. Adding a row manually to the old data (stored in td in your example) before binding it and then do the binding after you have manually added a row to the linq result.

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

Sidebar

Related Questions

Basically I have a gridview that I page through the server instead of in
I have a ASP.NET GridView that i created on a page through SharePoint Designer
I have a page that includes a GridView in it. That GridView is paged
I have one page (Products) that searches for products which are then displayed in
I have a gridview. I'm adding values with parameters->open connection->execute reader->connection close But the
I have a GridView that gets a DataSource. Now on RowDataBound, I need to
I have a gridview on my page that gets bound to user search results.
I have a GridView in a page with paging enabled (sorting not enabled, not
I have a gridview in ASP.NET. If I go to any page (obviously not
I have a devexpress gridview within my asp.net page which has a filter row.

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.