Home > Net >  C # is there any way you can submit a datagridview last line data is edited,
C # is there any way you can submit a datagridview last line data is edited,

Time:03-29

What method can be used to achieve: the AllowUserToAddRows=true
Datagridview last data submission for "edited line,"
(IsNewRow then it will be changed from true to false, and then add a new line after the last line)

CodePudding user response:

If the change to the building requirements, that doesn't go into an infinite loop?
Don't understand the meaning of the original poster requirements

CodePudding user response:

@ xuggzu is a bit complicated to explain, however, eventually by sending f2 button to enter edit, again to send a letter, send a delete it again, again send a TAB, solved the,,,


Probably a form, it can input, press a button, it automatically jump is a new line,
But if there is a button click function, it is to edit the lines of a cell is some data, it does not jump out of the new line,

, of course, I'm not saying it out of the new line, moving a new row to the current cell, but also in the penultimate line,

So I assign the value of some lines, it does not need to enter edit mode, to change what, can directly into the new line,

Ps.. Is limited by some reason, you can't use Rows. Add to do, or don't have such trouble,

CodePudding user response:

View the source:
[align=left] the if (this. DataGridView. NewRowIndex==index)
{
DataGridViewRowCollection_CannotDeleteNewRow throw new InvalidOperationException (SR. Get string (" "));
}
[/align]
Delete just compare the NewRowIndex fields, reflection calls AddNewRow, parameter true representative trigger UserAddedRow event
  •  Tags:  
  • C#