Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
405
WebGrid - How do I add new row to top of webgrid (clientside)
posted

I am using igtbl_addNew in javascript to add a new row in the grid.  However, it only allows me to add at the bottom of the grid.  Does anyone know how to add to the top of the grid?  Any help will be appreciated.  Thanks.

 

 

Parents
No Data
Reply
  • 14049
    Suggested Answer
    Offline posted
    The grid cannot move rows automatically. You'd need to save the
    reference to the row object that is returned by this function and then
    use remove() and insert off the parent collection.
    row.remove();
    grid.Rows.insert(row, 0);

    Help link for the rows collection methods and properties:
    http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR3.5/html/WebGrid_Rows_Object_CSOM.html
Children