예제 #1
0
 public override RowSection CreateRowSection(
     ListControl listControl,
     RowIdentifier rowIdentifier,
     HeaderSection headerSection,
     int position)
 {
     return(new MyRowSection(listControl, rowIdentifier, headerSection, position, _style));
 }
예제 #2
0
 public MyRowSection(
     ListControl listControl,
     RowIdentifier rowIdentifier,
     HeaderSection headerSection,
     int position)
     : base(listControl, rowIdentifier, headerSection, position)
 {
     _position = position;
 }
예제 #3
0
        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());
            }
        }
예제 #4
0
 public MyRowSection(
     ListControl listControl,
     RowIdentifier rowIdentifier,
     HeaderSection headerSection,
     int position,
     Style style)
     : base(listControl, rowIdentifier, headerSection, position)
 {
     _style = style;
 }
예제 #5
0
            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();
            }
예제 #6
0
            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();
            }
예제 #7
0
        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);
        }
예제 #8
0
        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;
        }
예제 #9
0
        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);
            }
        }
예제 #10
0
 public SelectItemForm(ListControl listControl)
 {
     InitializeComponent();
     _listControl.Columns.AddRange(listControl.Columns.ToArray());
     _listControl.Items.AddRange(listControl.Items.ToArray());
 }