Made a datagridview drag drop inside, there was a problem, for example: you need to drag the last line to the first place, while the first place is under the scrolling, how to do that when the mouse cursor gets closer to the top \ bottom of the datagridview, scrolling starts automatically up or down depending from the direction of dragging an item?
DataGridView.CellMouseEnter- occurs when you hover the mouse over a cell. We know how many rows fit in the visible part of the table. At the time of dragging the string, we will know and what cell we are now. If at the moment the mouse is pressed, and the index of the row selected and induced has a difference equal to the number of displayed rows minus one - change thedataGridView.CurrentCellproperty, depending on whether you get a positive or negative number - change it up or down. - Denis BubnovdataGridView.FirstDisplayedScrollingRowIndexinstead ofdataGridView.CurrentCellimplement this functionality - Denis BubnovdataGridView.FirstDisplayedScrollingRowIndex, hung it onMouse Move, Did so if the index of that under the arm andFirstDisplayedScrollingRowIndexare equal to each other thenFirstDisplayedScrollingRowIndex+1. But it works like that then it does not work then the timeline on which the mouse incorrectly counts = (. I will try withCurrentCell. - WinteriscomingFirstDisplayedScrollingRowIndex- Denis Bubnov Sept