Iam making a dynamic count in datagridview, i've done this in the followed ways. yet i can't solve it, perhaps someone else will know how to do my execution right.
i want it to do the followed;
the columns have to be counted (as rows) e.x. there are 30 columns you need to count from 0 to 30 and check each column 1by1, now the datatable is disposed on the load procedure so we can't get values from the datatable anymore, just the datagridview which is populated.
if somehow i could solve the cells[f] (count the cells from 0 to 30) than it would be solved but apperently somehow i cannot.
its hard to explain but i'd hope you will understand it.
int columnz = datatable.columns.count;
columns.Text = columnz.ToString();
for (int i = 0; i < dataGridView1.RowCount - 1; i++)
{
for (int f = 0; i <= Convert.ToInt64(columns.Text); i++)
{
if (dataGridView1.Rows[i].Cells[f].Value.ToString() == null)
{
dataGridView1.Rows.RemoveAt(i);
i--;
}
}
}
i've also tried to do Cells(f.tostring())... i dont know what to do anymore.