Click here to Skip to main content
15,884,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 26-Mar-20 7:13am

Try
C#
foreach (DataGridViewRow row in SizesDataGridView.Rows)
In your code row is of type DataGridView instead of DataGridViewRow
 
Share this answer
 
It's DataGridViewRow, not DataGridView

C#
foreach (DataGridViewRow row in SizesDataGridView.Rows)
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900