add rows in datagird one by one

Drheart

New member
Joined
Jul 27, 2009
Messages
2
Programming Experience
1-3
HI All ,

I am using datagrid in winform and got some textboxs wants to add the value of the text boxs into the datagrid after clicking on the add button .
so what i am facing now is that once adding one row it replace the previouse.. couldn't handle the loop or the if candation.
I will appriciate if you can help me on that ..

bellow is some codes samples .
' c is the datagird name

dim i as integer
for i = 0 to ????
c.Item(0, i).Value = TxT1.Text
c.Item(1, i).Value = txt2.Text
c.rows.add

next

as you see there is some unproper coddng for that i will appriciate your kind assistance.

Thank you
 
Add the new row using the overload that accepts an array of Object

c.Rows().Add(New Object() {Txt1.Text(), Txt2.Text})
 
You said yourself that your grid is in a Windows Form yet you didn't post in the Windows Forms forum. Please do us the courtesy of posting in the forum most appropriate for the topic, not just the first one you come to. Thread moved.
 
Back
Top