| |

VerySource

 Forgot password?
 Register
Search
View: 654|Reply: 2

How to navigate to a hidden column on the row being edited by the DataGridView?

[Copy link]

4

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-3-22 09:30:01
| Show all posts |Read mode
VS DataGridView.Columns [1] .Visible = false;

After binding the DataGridView, while inputting content on the bottom empty row (ie, a new row), how to automatically assign values ​​to Columns [1] of this row through code.
I don't know how to locate that cell.
What if I create multiple rows?
Reply

Use magic Report

2

Threads

9

Posts

10.00

Credits

Newbie

Rank: 1

Credits
10.00

 China

Post time: 2020-6-29 03:15:01
| Show all posts
datagridview.currentrow.columns[1].value="a value";//The cell of a column in the current row
Multiple lines need to use loop
for(i=0;i<this.datagridview.rows.count;i++)
{

datagridview.rows[i].columns[1].value="a value"
}
Reply

Use magic Report

4

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-6-29 09:45:01
| Show all posts
The foundation is not good, thank you for your help! Let me try
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list