471,348 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Foreach row in datagrid?

In the compact environment, how can I loop through the rows of a datagrid? I
what to look at column 3 of each row to determine if I need to insert or
update a record (column 3 is an ID).
Thanks
Jul 27 '08 #1
2 5344
On Sun, 27 Jul 2008 10:30:02 -0700, Phill
<Ph***@discussions.microsoft.comwrote:
In the compact environment, how can I loop through the rows of a
datagrid? I
what to look at column 3 of each row to determine if I need to insert or
update a record (column 3 is an ID).
Is your question really specific to the Compact Framework? If so, you
probably should post it in the CF newsgroup.

If not, then it seems to me you just need to get the DataSource property
of the DataGrid and enumerate over that collection's members.

Pete
Jul 27 '08 #2
On Sun, 27 Jul 2008 10:30:02 -0700, Phill wrote:
In the compact environment, how can I loop through the rows of a
datagrid? I what to look at column 3 of each row to determine if I need
to insert or update a record (column 3 is an ID).
Thanks
foreach (DataGridViewRow player in grid.Rows)
{
if (temp.playerLookup.ContainsKey(Convert.ToInt32(pla yer.Cells
["id"].Value)))
{
player.Visible = false;
}
}
Jul 28 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Phil | last post: by
3 posts views Thread by Gidi | last post: by
104 posts views Thread by cody | last post: by
27 posts views Thread by Tripper | last post: by
3 posts views Thread by Wiktor Zychla [C# MVP] | last post: by
29 posts views Thread by ApeX | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.