Hello to all. Such a problem:
There is a DataGridView. It displays information from the database table. There are also two buttons Add and Remove, from the name it is clear what they are doing.
I need to make it so that I forbid the user to use the Remove button on those rows that were previously listed in the table, before opening the program. The Remove button should be available only for those lines that were added during program execution; as soon as I closed and re-opened it, the Remove button became unavailable for those lines.
In principle, the problem is elementary, but I would like to make it more advanced. As expected, so to speak. At this time, I have a table, in each row of the table there is a root field, which gives the right of the Remove button to be unlocked or locked. But I would like, of course, to get rid of this field, and do it in a normal way.
There were also thoughts to check the status of the DataRow row, and if it is a DataRowState.Added, then unlock the button, otherwise not ... but something didn’t work out for me with this ...
Somebody knows?