public void ApplySort(PropertyDescriptor property, System.ComponentModel.ListSortDirection direction) { _sort = (CsvPropertyDescriptor)property; _direction = direction; _csv.ReadToEnd(); _csv._records.Sort(new CsvRecordComparer(_sort.Index, _direction)); }
public PropertyDescriptorCollection GetItemProperties(PropertyDescriptor[] listAccessors) { if (_properties == null) { PropertyDescriptor[] properties = new PropertyDescriptor[_csv.FieldCount]; for (int i = 0; i < properties.Length; i++) { properties[i] = new CsvPropertyDescriptor(((System.Data.IDataReader)_csv).GetName(i), i); } _properties = new PropertyDescriptorCollection(properties); } return(_properties); }
public void RemoveSort() { _sort = null; _direction = ListSortDirection.Ascending; }