I'm trying to set up a ListView with two groups that allows the user to:
1. Drag and Drop items within the first group only. The user can sequence (non-group) items in that part of the list. Only one item at a time should be dragged/dropped. (The drag/drop example I found on the forum doesn't work well with groups. It removes items. But it works well if I eliminate my groups.)
2. Double click an item to move it from its current group to the other group. I got this much code to work. What I need to work out still is to prevent double-clicking on a group item from expanding/collapsing that group.
Thank you,
Gary
1. Drag and Drop items within the first group only. The user can sequence (non-group) items in that part of the list. Only one item at a time should be dragged/dropped. (The drag/drop example I found on the forum doesn't work well with groups. It removes items. But it works well if I eliminate my groups.)
2. Double click an item to move it from its current group to the other group. I got this much code to work. What I need to work out still is to prevent double-clicking on a group item from expanding/collapsing that group.
private
void
lvMain_DoubleClick(
object
sender, EventArgs e)
{
if
(lvMain.SelectedItem.GetType() ==
typeof
(ListViewDataItem))
{
if
(lvMain.SelectedItem.Group == lvMain.Groups[0])
{
lvMain.SelectedItem.Group = lvMain.Groups[1];
}
else
{
lvMain.SelectedItem.Group = lvMain.Groups[0];
}
}
}
Thank you,
Gary