public DataSourceGettingStarted()
        {
            tableView                    = new UITableView();
            tableView.RowHeight          = 100;
            tableView.SeparatorColor     = UIColor.Clear;
            tableView.EstimatedRowHeight = 100;
            viewModel                    = new DataSourceGettingStartedViewModel();
            viewModel.SetRowstoGenerate(100);
            sfDataSource        = new DataSource();
            sfDataSource.Source = viewModel.BookInfo;
            sfDataSource.DisplayItems.CollectionChanged += DisplayItems_CollectionChanged;
            sfDataSource.LiveDataUpdateMode              = Syncfusion.DataSource.LiveDataUpdateMode.AllowDataShaping;
            sfDataSource.SortDescriptors.Add(new SortDescriptor()
            {
                Direction    = Syncfusion.DataSource.ListSortDirection.Descending,
                PropertyName = "BookID",
            });

            tableView.Source = new TableViewSource(sfDataSource);

            searchbar = new UISearchBar();
            searchbar.OnEditingStarted             += HandleOnEditingStarted;
            searchbar.TextChanged                  += HandleTextChanged;
            searchbar.CancelButtonClicked          += HandleCancelButtonClicked;
            searchbar.EnablesReturnKeyAutomatically = false;
            searchbar.Placeholder                   = "Search in All Columns";
            viewModel.filtertextchanged             = OnFilterChanged;
            option          = new DataSourceOptionsView(viewModel, searchbar, this);
            this.OptionView = option;

            this.AddSubview(searchbar);
            this.AddSubview(this.tableView);
        }
        public override Android.Views.View GetSampleContent(Android.Content.Context context)
        {
            LinearLayout linear = new LinearLayout(context);

            linear.Orientation = Orientation.Vertical;
            dataSource         = new DataSource();
            viewModel          = new DataSourceGettingStartedViewModel(context);
            viewModel.SetRowstoGenerate(100);
            listView = new ListView(context);

            dataSource.Source             = viewModel.BookInfo;
            dataSource.LiveDataUpdateMode = Syncfusion.DataSource.LiveDataUpdateMode.AllowDataShaping;
            dataSource.SortDescriptors.Add(new SortDescriptor()
            {
                Direction    = Syncfusion.DataSource.ListSortDirection.Descending,
                PropertyName = "BookID",
            });

            listView.Adapter = new CustomAdapter(dataSource, context);
            filterText       = new SearchView(context);
            filterText.SetIconifiedByDefault(false);
            filterText.SetPadding(0, 0, 0, (int)(10 * context.Resources.DisplayMetrics.Density));
            this.filterText.KeyPress += FilterText_KeyPress;
            filterText.SetQueryHint("Enter the text to filter");
            filterText.QueryTextChange += OnFilterTextChanged;
            viewModel.Filtertextchanged = OnFilterChanged;
            linear.AddView(new LinearLayout(context)
            {
                Focusable = true, FocusableInTouchMode = true
            }, 0, 0);
            linear.AddView(filterText);
            linear.AddView(listView);
            return(linear);
        }
 public override void Destroy()
 {
     dataSource.Dispose();
     conditionDropdown = null;
     columnDropdown    = null;
     filterText        = null;
     columnTextView    = null;
     conditionTextView = null;
     dataSource        = null;
     viewModel         = null;
     condtionAdapter   = null;
     gridlayout.RemoveAllViews();
     gridlayout = null;
 }
 public DataSourceGettingStarted()
 {
     InitializeComponent();
     viewModel           = new DataSourceGettingStartedViewModel();
     sfDataSource        = new DataSource();
     sfDataSource.Source = viewModel.BookInfo as IEnumerable <BookDetails>;
     sfDataSource.BeginInit();
     viewModel.filtertextchanged = OnFilterChanged;
     sfDataSource.SortDescriptors.Add(new SortDescriptor()
     {
         Direction    = ListSortDirection.Descending,
         PropertyName = "BookID",
     });
     sfDataSource.EndInit();
     listView.ItemsSource      = sfDataSource.DisplayItems;
     ColumnsList.SelectedIndex = 0;
 }
Пример #5
0
        public DataSourceOptionsView(DataSourceGettingStartedViewModel model, UISearchBar bar, DataSourceGettingStarted parentView)
            : this()
        {
            this.ParentView  = parentView;
            this.filtermodel = model;
            var columnnames = filtermodel.BookInfo.GetType().GetGenericArguments()[0].GetProperties();

            this.bar = bar;
            foreach (var propety in columnnames)
            {
                items.Add(propety.Name);
            }
            table.Source = new ColumnOptionsTableSource(items);
            filterconditiontable.Source = new DataSourceFilterOptionsTableSource(new List <string>()
            {
                "Contains",
                "Equals",
                "Not Equals"
            });
            this.AddSubview(filterconditiontable);
            this.AddSubview(table);
        }