private void MapListVw_ColumnClick(object sender, ColumnClickEventArgs e)
        {
            // Determine if clicked column is already the column that is being sorted.
            if (e.Column == _lvwItemComparer.SortColumn)
            {
                // Reverse the current sort direction for this column.
                if (_lvwItemComparer.Order == SortOrder.Ascending)
                {
                    _lvwItemComparer.Order = SortOrder.Descending;
                }
                else
                {
                    _lvwItemComparer.Order = SortOrder.Ascending;
                }
            }
            else
            {
                // Set the column number that is to be sorted; default to ascending.
                _lvwItemComparer.SortColumn = e.Column;
                _lvwItemComparer.Order      = SortOrder.Ascending;
            }

            // Perform the sort with these new sort options.
            MapListVw.Sort();
        }
Beispiel #2
0
        private void MapListVw_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            ListViewHitTestInfo hitInfo = MapListVw.HitTest(e.Location);

            if (hitInfo.Item != null)
            {
                hitInfo.Item.Selected = true;

                MapNoteDetails dlg = new MapNoteDetails();
                dlg.MapNoteItem = (MapNoteItem)hitInfo.Item.Tag;

                if (dlg.ShowDialog(this) == DialogResult.OK)
                {
                    FillList();
                }
            }
        }