Home > Net >  C # winform DataGridView in the SelectionChanged event triggering time there was a problem
C # winform DataGridView in the SelectionChanged event triggering time there was a problem

Time:12-03

DataGridView the SelectionChanged event official explanation is the currently selected content when changes occur, in use process found some problems, I want to be in user switches selected row processing business,

Use: dgvHerb. CurrentCell=dgvHerb. Rows [index] Cells [0].
Or dgvHerb. Rows [index]. Selected=true;
To change the currently selected rows, the code into the SelectionChanged event, dgvHerb. CurrentRow does not change
If the user mouse operation switch line, the code into the SelectionChanged event, dgvHerb. CurrentRow change, become the user to select the line
The great god, please give directions, what reason is this?

CodePudding user response:

Their top, a great god show

CodePudding user response:

Only speak a little, there is a difference between the current and selected

CodePudding user response:

How the currently selected rows can be optional, CurrentRow as if only the current cell is the line,,

CodePudding user response:

I also met, when the load to the DataGridView, where is the debug waiting time long enough current guild effect, after running the program is not directly,
  •  Tags:  
  • C#
  • Related