In a Windows App (Visual Studio)(VB) how do you drag and drop a single row to another postition to allow for the user to re-order the row? I haven't found any worthy examples for this yet.
相关问题
- 'System.Threading.ThreadAbortException' in
- Visual Studio 2010 randomly says the command line
- how to use special characters like '<'
- (ASP.NET) Project file must include 'WindowsBa
- How do I bind a DataGridViewComboBoxColumn to a pr
相关文章
- vb.net 关于xps文件操作问题
- C# Winform 生成的两个DatagridViewTreeViewSelectColumn列该
- How to show location of errors, references to memb
- Log4Net Multiple Projects
- Compiling error in C++ project with C and C++ code
- How to use Mercurial from Visual Studio 2010?
- Checking for DBNull throws a StrongTypingException
- Using the typical get set properties in C#… with p
Thank you for everything, code working. I was getting only one error. I solved it.
if the datagridview "Enable Editing" is set, you receive an error when you throw line spacing. You can try. I solved it as follows:
Thanks for all other information
Here's a Control without the mentioned bug.
Set
AllowUserToOrderRows
andAllowDrop
toTrue
in the Windows Forms Designer and drag the row headers, not the content.1.5 improvements for the event GridView.DragDrop:
The first 50% improvement, To avoid the descriped error you can also use
Second is to set focus to the current row and the first cell:
Here is a vb version from this C# answer: How could I Drag and Drop DataGridView Rows under each other?
The form class variables:
The drag events:
The mouse events:
Make sure you have the grids
AllowDrop
property set to true.UPDATE:
Instead of
change to
then a error occurs when you drag a row to the "blank zone", if you don't believe me, you must to try it.
the final code (Only for the part "The drag events") is this: