Ejemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            var list = DataPortal.Create <DataList>();

            list.Add(DataPortal.CreateChild <Data>(213, "abc"));
            list.Add(DataPortal.CreateChild <Data>(113, "qwe"));
            list.Add(DataPortal.CreateChild <Data>(413, "zcx"));
            list.Add(DataPortal.CreateChild <Data>(233, "abc"));
            list.Add(DataPortal.CreateChild <Data>(215, "ler"));

            this.dataListBindingSource.DataSource = list;

            this.sortedBindingSource.DataSource = new Csla.SortedBindingList <Data>(list);

            var filtered = new Csla.FilteredBindingList <Data>(list);

            this.filteredBindingSource.DataSource = filtered;
            filtered.ApplyFilter("Name", "abc");
        }
Ejemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            var listPortal = Program.ApplicationContext.GetRequiredService <IDataPortal <DataList> >();
            var itemPortal = Program.ApplicationContext.GetRequiredService <IChildDataPortal <Data> >();
            var list       = listPortal.Create();

            list.Add(itemPortal.CreateChild(213, "abc"));
            list.Add(itemPortal.CreateChild(113, "qwe"));
            list.Add(itemPortal.CreateChild(413, "zcx"));
            list.Add(itemPortal.CreateChild(233, "abc"));
            list.Add(itemPortal.CreateChild(215, "ler"));

            this.dataListBindingSource.DataSource = list;

            this.sortedBindingSource.DataSource = new Csla.SortedBindingList <Data>(list);

            var filtered = new Csla.FilteredBindingList <Data>(list);

            this.filteredBindingSource.DataSource = filtered;
            filtered.ApplyFilter("Name", "abc");
        }