Friday, October 19, 2012

How to Get the Selected Cells and Rows in the Windows Forms DataGridView Control

Here basically I am showing how to get selected cells/rows in DataGridView Control and use of IEnumerator while accessing them.

                DataGridViewSelectedRowCollection m = dataGrid_ZipList.SelectedRows;
                DataGridViewRow row;
                IEnumerator Enumerator = m.GetEnumerator();
                while (Enumerator.MoveNext())
                    row = (DataGridViewRow)Enumerator.Current;

No comments:

Post a Comment