How to insert a row in a DataGrid in code?

Discussion in 'ASP .Net Datagrid Control' started by Bill, Jul 13, 2005.

  1. Bill

    Bill Guest

    I thought I could insert a new row in a DataGrid in code by calling

    CurrencyManager.AddNew;

    but it does not work. I want to open a new row that the user will then
    fill in. What am I missing?

    --
    ..Bill.
     
    Bill, Jul 13, 2005
    #1
    1. Advertising

  2. Hi Bill

    Create a new row using DataGrid's DataSource. Get the datasource and add a
    new row in the table of
    that data source then set the edit index to the index of that row in the
    table (index will be
    dataTable.rows.count -1 in C# and dataTable.rows.count in VB).

    Regards
    Fiaz Ali Saleemi

    "Bill" <> wrote in message
    news:eHWKUd$...
    > I thought I could insert a new row in a DataGrid in code by calling
    >
    > CurrencyManager.AddNew;
    >
    > but it does not work. I want to open a new row that the user will then
    > fill in. What am I missing?
    >
    > --
    > .Bill.
     
    Fiaz Ali Saleemi, Jul 14, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dan Sikorsky
    Replies:
    2
    Views:
    11,563
    SiliconViper
    Apr 30, 2009
  2. D
    Replies:
    0
    Views:
    257
  3. Andrus

    Insert new row before current row

    Andrus, Jun 29, 2003, in forum: Javascript
    Replies:
    0
    Views:
    122
    Andrus
    Jun 29, 2003
  4. Sergio del Amo
    Replies:
    4
    Views:
    267
  5. Giggle Girl

    ie6 Insert Row at specific Row Index of Table

    Giggle Girl, Feb 5, 2006, in forum: Javascript
    Replies:
    18
    Views:
    332
    Thomas 'PointedEars' Lahn
    Feb 7, 2006
Loading...

Share This Page