I'm trying to add more than one row in my bindingsource based on a number in a textbox.
For instance if textbox1 has a value of '50' and I click Add new row I want to prepare 50 new rows that can be populated in a datagrid then saved all in one go.
I'm using chequeBindingSource.AddNew(); to make 1 new row, but I would like to add as many new rows as the number in textbox1, is that possible?
Hope I've been clear.
Loading
VulpesPosted May 22, 2014, 8:42 AM
mike DelvottiPosted May 22, 2014, 9:55 AM
Thanks Vulpes :-)
VulpesPosted May 22, 2014, 9:46 AM
mike DelvottiPosted May 22, 2014, 9:00 AM
I have another quick question that would be great, the above works fine so if I entered 10 in the textbox it adds 10 new rows as expected, basically in column [1] of my datagrid row.cells will be a cheque number.
I would like to do something similar with another textbox2 and enter 10005 then when the 10 new rows start (or whatever textbox1 value is) row.cells[1] populates with 10005 and increments up populating each line in row.cells[1] with 10006 then on next row 10007 filling up the 10 new rows.
so a user enters how many new rows they wish to start in textbox one then enters the starting cheque number in textbox2 if textbox1 is '10' then ten new rows start pre-populating row.cells with the cheque number incrementing up.
Hopefully you get the idea where I'm going with that ;-)
Bhabani PrasadPosted May 22, 2014, 8:42 AM
http://www.dreamincode.net/forums/topic/39260-adding-rows-to-a-data-grid-view/