public override RowSection CreateRowSection( ListControl listControl, RowIdentifier rowIdentifier, HeaderSection headerSection, int position) { return(new MyRowSection(listControl, rowIdentifier, headerSection, position, _style)); }
public MyRowSection( ListControl listControl, RowIdentifier rowIdentifier, HeaderSection headerSection, int position) : base(listControl, rowIdentifier, headerSection, position) { _position = position; }
private void PopulateList(ListControl listControl) { const int iterationCount = 1; // Change this if you want to increas the number of items in the list for (int i = 0; i < iterationCount; i++) { listControl.Items.AddRange(Person.GetData()); } }
public MyRowSection( ListControl listControl, RowIdentifier rowIdentifier, HeaderSection headerSection, int position, Style style) : base(listControl, rowIdentifier, headerSection, position) { _style = style; }
public EmailPreviewExample(ListControl listControl, Style style) { _oldFactory = listControl.SectionFactory; // store old factory as we want to leave as we came. _listControl = listControl; // // Replace the current SectionFactory with our override. listControl.SectionFactory = new MySectionFactory(style); // _listControl.LayoutSections(); }
public RowOverrideExample(ListControl listControl) { _oldFactory = listControl.SectionFactory; // store old factory as we want to leave as we came. _listControl = listControl; // // Replace the current SectionFactory with our override. listControl.SectionFactory = new MySectionFactory(); // _listControl.LayoutSections(); }
private void CreateColumns(ListControl listControl) { Column surnameColumn; Column firstnameColumn; Column phoneColumn; Column cityColumn; Column stateColumn; Column dateColumn; surnameColumn = new Column("surname", "Surname", 120, delegate(object item) { return(((Person)item).Surname); }); firstnameColumn = new Column("firstname", "Firstname", 120, delegate(object item) { return(((Person)item).Firstname); }); phoneColumn = new Column("phone", "Phone", 100, delegate(object item) { return(((Person)item).Phone); }); cityColumn = new Column("city", "City", 60, delegate(object item) { return(((Person)item).City); }); stateColumn = new Column("state", "State", 70, delegate(object item) { return(((Person)item).State); }); dateColumn = new Column("date", "Date", 110, delegate(object item) { return(((Person)item).Date.ToString()); }); dateColumn.GroupItemAccessor = GroupValueFromItem; dateColumn.MoveBehaviour = Column.MoveToGroupBehaviour.Copy; dateColumn.GroupSortOrder = SortOrder.Descending; surnameColumn.SortOrder = SortOrder.Ascending; listControl.Columns.Add(firstnameColumn); listControl.Columns.Add(phoneColumn); listControl.Columns.Add(stateColumn); listControl.Columns.Add(cityColumn); listControl.Columns.Add(dateColumn); listControl.Columns.GroupedItems.Add(dateColumn); listControl.Columns.GroupedItems.Add(stateColumn); }
void _listControl_DragOverEx(object sender, SuperlistDragEventArgs ea) { ListControl senderControl = sender as ListControl; if (senderControl != null) { Person[] items = PersonsFromDataObject(ea.DragEventArgs.Data); foreach (Person p in items) { if (senderControl.Items.IndexOf(p) != -1) { return; // don't allow items to be dropped on ourself. } } ea.SectionAllowedToDropOn = ea.SectionOver; return; } ea.DragEventArgs.Effect = DragDropEffects.None; }
void _listControl_DragDropEx(object sender, SuperlistDragEventArgs ea) { ListControl senderControl = sender as ListControl; if (senderControl != null) { Person[] persons = PersonsFromDataObject(ea.DragEventArgs.Data); if (sender == _listControl1) // we remove the persons from the other list in this example and add to the sender { _listControl2.Items.RemoveRange(persons); } else { _listControl1.Items.RemoveRange(persons); } senderControl.Items.AddRange(persons); } }
public SelectItemForm(ListControl listControl) { InitializeComponent(); _listControl.Columns.AddRange(listControl.Columns.ToArray()); _listControl.Items.AddRange(listControl.Items.ToArray()); }