Using the code below, I get this error.
Using the generic type 'System.Collect ions.Generic.IC omparer<T>' requires
'1' type arguments
Please tell me how to put this right.
Adrian.
// Implements the manual sorting of items by columns.
class ListViewItemCom parer : IComparer
{
private int col;
public ListViewItemCom parer()
{
col = 0;
}
public ListViewItemCom parer(int column)
{
col = column;
}
public int Compare(object x, object y)
{
return String.Compare( ((ListViewItem) x).SubItems[col].Text,
((ListViewItem) y).SubItems[col].Text);
}
}
// ColumnClick event handler.
private void ColumnClick(obj ect o, ColumnClickEven tArgs e)
{
// Set the ListViewItemSor ter property to a new
ListViewItemCom parer object.
this.listView1. ListViewItemSor ter = new
ListViewItemCom parer(e.Column) ;
// Call the sort method to manually sort the column based on the
ListViewItemCom parer implementation.
listView1.Sort( );
}
Comment