help plz....hi i wud like to know how to count each row of a datagrid and display the answer in a textbox. thks

Count each row or sum up a column?

Use dataGridView1.Rows.Count property.

Count n sum up too.

assuming u want to sum up the values of first column

dim counter as integer = 0
dim sum as integer = 0
while counter < datagridview1.rows.count
sum = sum+datagridview1.items(0,counter).value
counter = counter +1
end while

fgvhgvhgyghvgyhbvhgy

I'm cannot run at the cmd to become a exe.file application


"now how I to do this"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.