Community discussion forum

Adding new row on top of grid

Tags: India
  • 1 year ago

    Hi,

     Please let me know how to add a new row on top of other existing rows in a grid.

    /Tabrez

  • 1 year ago
    Please don't assume we can read minds.  What type of grid?  Is it bound or unbound?  Please take the time and make the effort to post a clear and complete description of what you want.  Then we waste as little time as possible getting you the answer you want.
  • 1 year ago

    Ok. It is a datagrid and is bounded to a dataset.

  • 1 year ago
    Then you'd need to create a new DataRow from your DataTable and call Rows.InsertAt to insret it at the first position.  That will, of course, only work if you haven't sorted the data.
  • 1 year ago

    Am sorry to say but the solution you gave will work for ASP or C#. I need a code for VB.NET. Anybody?

    Tabrez

  • 1 year ago
    That's complete twaddle.  What I suggested will work in a VB.NET WinForms app.  Did you even try it?  If you did and it didn't work then show us the code you used so we can show you where you went wrong.
  • 1 year ago

    I want to add the new row in the grid and not in the datarow. Anywyz, the requirement is removed as of now. but if it is needed in future will surely get back to you. :)

    /Tabrez 

Post a reply

Enter your message below

Sign in or Join us (it's free).

Want to stay in touch with what's going on? Follow us on twitter!