I need to be able to add multiple rows client side. I have tried to use igtbl_addNew, but it wont add multiple new lines without there being data in each existing lines. Anyone know a way around this?
Hi,
U can use the following code.
var j = txtRows.value; for(var i=0; i < j; i++) { row=myGrid.Rows.addNew(); }
Thanks,
Kedar.
That code seems to be server side. In the application I am doing, I want to allow the user to enter several lines of data without posting back to the server until they click a submit button. To complicate matters, they would like to be able to enter a number of lines to add and add them all at one time.
I was hoping that someone would have tried this before me and could tell me how to get it accomplished.
Rob,
Try this:
function AddBlankGridRows_Click(oButton, oEvent) //this is called via a web image button click....{ var tbAddRows = document.getElementById("ctl00_cphContent_tbRowCnt"); //get text box... var addRowCnt = tbAddRows.value; //a text box with the number of rows you want to add... var aNum ; var grid = igtbl_getGridById("ctl00_cphContent_GRIDNAME"); if (addRowCnt == "") { grid.Rows.addNew(); } else if (addRowCnt != "") { for (aNum = 1; aNum <= addRowCnt; aNum++) { grid.Rows.addNew(); } tbAddRows.value = ""; } }}