Click here to Skip to main content
14,486,715 members
Rate this:
Please Sign up or sign in to vote.
See more:
foreach (DataGridView row in SizesDataGridView.Rows)
    {
                row.Cells["Select"].Value = 0;
        } 
row.Cells["Select"].Value=0 pa ya error a raha ha.
DataGridView does not contain a definition for Cells and no accessible extension method cells acception a first argument of type.........


What I have tried:

foreach (DataGridView row in SizesDataGridView.Rows)
    {
                row.Cells["Select"].Value = 0;
        } 
row.Cells["Select"].Value=0 pa ya error a raha ha.
DataGridView does not contain a definition for Cells and no accessible extension method cells acception a first argument of type.........
Posted
Updated 4 days ago
Rate this:
Please Sign up or sign in to vote.

Solution 1

Try
foreach (DataGridViewRow row in SizesDataGridView.Rows)
In your code row is of type DataGridView instead of DataGridViewRow
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

It's DataGridViewRow, not DataGridView

foreach (DataGridViewRow row in SizesDataGridView.Rows)
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100