Binding Esnasında DataGridView Rows Clear

Merhabalar main formda bulunan bır data gridi otomatik olarak bind eden bir fonksiyon için kullanılabilir.

//usage : 

//ClearRows(dataGridView1);

public void ClearRows(DataGridView dg)
        {
            int rowCount = dg.Rows.Count;
            if (rowCount != 0 | rowCount != -1)
            {

                for (int i = 0; i < rowCount; i++)
                {

                    dg.Rows.RemoveAt(i);

                    --rowCount;
                }
            }

            }

This entry was posted on Pazar, Ağustos 9th, 2009 at 16:11 and is filed under C#. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.

Leave a Reply