List Info

Thread: C-Sharp (C#) Group: DataGridViewChechBoxColumn getting values




C-Sharp (C#) Group: DataGridViewChechBoxColumn getting values
user name
2006-06-07 23:27:51
Hi. I'm wonking in a DataGridView grid that has a
DataGridViewChechBoxColumn. I came up with this way of
checking which
rows are selected

            foreach(DataRow dr in gridSelected.Rows)
            {
                if
(((DataGridViewCheckBoxColumn)dr[0]).Selected)
                {
                    //Process rows
                }
            }

but I'm a little concern about the performance. If you
notice, I'm
using a foreach and also casting each column of each row. Is
there a
better way to do this? I was expecting something like
gridSelected.SelectedRows that would give me an array with
the selected
ones, but I just cannot find such method. Anybody?

Thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C-Sharp (C#)" group.
To post to this group, send email to C_Sharpgooglegroups.com
To unsubscribe from this group, send email to
C_Sharp-unsubscribegooglegroups.com
For more options, visit this group at http://groups.
google.com/group/C_Sharp
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )