This article has been dead for over three months
You
public void GroupListView(ListView lstV, int SubItemIndex)
{
bool flag = true;
foreach (ListViewItem l in lstV.Items)
{
string strmyGroupname = l.SubItems[SubItemIndex].Text;
foreach (ListViewGroup lvg in lstV.Groups)
{
if (lvg.Name == strmyGroupname)
{
l.Group = lvg;
flag = false;
}
}
if (flag == true)
{
ListViewGroup lstGrp = new ListViewGroup(strmyGroupname, strmyGroupname);
lstV.Groups.Add(lstGrp);
l.Group = lstGrp;
}
flag = true;
}
}