how can I add many rows at one time?

10 replies. Last post: June 21, 2010 10:31 PM by Heny
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Heny Member

hi,

I can add a new row in my grid,but I find an question like picture in attachment when I use cycle to add 5 Rows in grid!  

my code:

function WebButton1_Click() {

    var grid = ISGetObject("WebGrid1");
   for (var i=0;i<5;i++)
   {
    var totalRows = grid.TotalRows;
    var newRow = grid.RootTable.NewRow();
    var newCells = newRow.GetCells();

    newCells.GetNamedItem("vouid").SetText(totalRows + 1, true);
    newCells.GetNamedItem("商品编号").SetText("", true);
    newCells.GetNamedItem("商品名称").SetText("", true);
    newCells.GetNamedItem("商品规格").SetText("", true);
    newCells.GetNamedItem("包装单位").SetText("", true);
    newCells.GetNamedItem("数量").SetText("", true);
    newCells.GetNamedItem("价格范围").SetText("", true);
    newCells.GetNamedItem("备注").SetText("", true);
    newRow.Update();
     }
}

How can i solve it?

1 attachment
All times are GMT -5. The time now is 11:29 PM.
Previous Next