I developed some custom datagridview cells which contain specialized user controls, e.g. for synchronizing data between a client machine and a server containing up- and download buttons within a user control.
I have them fundamentally working .....
but I have several problems, which I think come from unsharing of rows when starting to edit a row, which seems to remove a shared cell and replace it by 2 or more new cells. As the removed cell still contains my control, this control is still visible and is "floating" around the window. I didn't yet find a reliable way to detect, when a cell is no longer needed.
The cell containing my user control is not editable itself and the column is marked as readonly. This column hosting the user control cell is using an expression defined in a typed dataset column to set it's value from the value of another cell. A typed dataset is bound to the datagridview via a binding source.
Everything works quite well as long as the datarow isn't unshared.
What is the recommended way to host user controls in a datagridview cell?
I read, that someone will prepare a white paper about custom datagridview columns. Maybe he can also give advice about this topic.
Moreover I noticed, that when overriding the SetValue method in the DataGridViewCell, only NULL values are passed in when the datagridview is populated from data of the binding source. But later the base cell contains the correct data.