Hello,
I'm trying to move listView items (1 selected item only) up & do, but only inside the group, I've trying and search but haven't been able to quiet figure it out, this is what I got so far:
Just for going up:
if (this.listView1.SelectedItems.Count > 0)
{
ListViewItem Selected = this.listView1.SelectedItems[0];
ListViewGroup SelectedGroup = new ListViewGroup(this.listView1.SelectedItems[0].Group.Header);
int phIndex = Selected.Index;;
if (Selected.Group.Header == this.listView1.Items[phIndex - 1].Group.Header)
{
if (phIndex != 0)
{
this.listView1.Items.RemoveAt(Selected.Index);
this.listView1.Items.Insert(phIndex - 1, Selected);
this.listView1.Groups.Insert(phIndex, SelectedGroup);
}
}
}
Item needs to move up inside the group.