Ejemplo n.º 1
0
        public void CheckFkSelection()
        {
            var cc = new ColumnChooser <Image>(_fakeDb, new List <string>(), null).ForginKey <Book>();

            Assert.That(cc, Is.Not.Null);
            Assert.That(cc._columns, Contains.Item(ImageMeta.ForgeinKeyName));
        }
Ejemplo n.º 2
0
        private void columnKryptonCheckedListBox_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            ColumnChooser cc = (ColumnChooser)columnKryptonCheckedListBox.Items[e.Index];

            cc.COLUMN.Visible = e.NewValue == CheckState.Checked;
            Type p = columnKryptonCheckedListBox.Items[e.Index].GetType();
        }
Ejemplo n.º 3
0
        public void CheckPkSelection()
        {
            var cc = new ColumnChooser <Users>(_fakeDb, new List <string>(), null).PrimaryKey();

            Assert.That(cc, Is.Not.Null);
            Assert.That(cc._columns, Contains.Item(UsersMeta.PrimaryKeyName));
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     chooserWindow = new ColumnChooser(this.dataGrid)
     {
         Width = 300, Height = 500
     };
     this.dataGrid.GridColumnDragDropController = new GridColumnChooserController(this.dataGrid, chooserWindow);
     chooserWindow.Show();
     chooserWindow.Owner = this;
 }
 /// <summary>
 /// Occurs when the SfDataGrid is laid out, rendered, and ready for interaction.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void OnSfDataGridLoaded(object sender, RoutedEventArgs e)
 {
     chooserWindow = new ColumnChooser(this.sfGrid);
     chooserWindow.Resources.MergedDictionaries.Clear();
     this.sfGrid.GridColumnDragDropController = new GridColumnChooserController(this.sfGrid, chooserWindow);
     ShowColumnChooser();
     viewModel.toggled = OnToggled;
     viewModel.ColumnChooserCommand = new DelegateCommand <object>(ColumnChooserCommandHandler);
     chooserWindow.Popup.Closed    += OnPopup_Closed;
 }
Ejemplo n.º 6
0
        public void CheckPropertyLamdaWithPrefix()
        {
            var cc = new ColumnChooser <Users>(_fakeDb, new List <string>(), Prefix);

            Assert.That(cc.Cache, Is.Not.Null);
            Assert.That(cc._columns, Is.Empty);
            var cc2 = cc.Column(f => f.UserID);

            Assert.That(cc2._columns, Contains.Item(Prefix + "." + UsersMeta.PrimaryKeyName));
        }
Ejemplo n.º 7
0
        public void CheckPropertyInvalidValuePrefix()
        {
            var cc = new ColumnChooser <Users>(_fakeDb, new List <string>(), Prefix);

            Assert.That(cc.Cache, Is.Not.Null);
            Assert.That(cc._columns, Is.Empty);
            var cc2 = cc.Column("xxx");

            Assert.That(cc2._columns, Contains.Item(Prefix + ".xxx"));
        }
Ejemplo n.º 8
0
        public void CheckPropertyDirect()
        {
            var cc = new ColumnChooser <Users>(_fakeDb, new List <string>(), null);

            Assert.That(cc.Cache, Is.Not.Null);
            Assert.That(cc._columns, Is.Empty);
            var cc2 = cc.Column(UsersMeta.PrimaryKeyName);

            Assert.That(cc2._columns, Contains.Item(UsersMeta.PrimaryKeyName));
        }
Ejemplo n.º 9
0
 void InitializeColumnChooserPopup()
 {
     chooserWindow = new ColumnChooser(this.AssociatedObject.dataGrid);
     chooserWindow.Resources.MergedDictionaries.Clear();
     chooserWindow.ClearValue(ColumnChooser.StyleProperty);
     chooserWindow.Resources.MergedDictionaries.Add(this.AssociatedObject.MainGrid.Resources.MergedDictionaries[0]);
     this.AssociatedObject.dataGrid.GridColumnDragDropController = new GridColumnChooserController(this.AssociatedObject.dataGrid, chooserWindow);
     chooserWindow.Show();
     chooserWindow.Owner    = this.AssociatedObject;
     chooserWindow.Closing += chooserWindow_Closing;
 }
Ejemplo n.º 10
0
        void InitializeColumnChooserPopup()
        {
            chooserWindow        = new ColumnChooser(this.AssociatedObject.dataGrid);
            chooserWindow.Width  = 200;
            chooserWindow.Height = 220;
            chooserWindow.Resources.MergedDictionaries.Clear();
            chooserWindow.ClearValue(ColumnChooser.StyleProperty);
            SfSkinManagerExtension.SetTheme(this.AssociatedObject, chooserWindow);
            this.AssociatedObject.dataGrid.GridColumnDragDropController = new GridColumnChooserController(this.AssociatedObject.dataGrid, chooserWindow);
            chooserWindow.Show();

            chooserWindow.Owner    = this.AssociatedObject;
            chooserWindow.Closing += chooserWindow_Closing;
        }
        private void mnuChooseColumns(object sender, RoutedEventArgs e)
        {
            var dict = new Dictionary <Type, IValueConverter>();

            dict.Add(typeof(DateTime), new DateConverter());
            dict.Add(typeof(DrawingCategory), new DrawingCategoryConverter());
            dict.Add(typeof(DateTime?), new DateConverter());
            dict.Add(typeof(DrawingStatus), new DrawingStatusConverter());
            var c = new ColumnChooser(typeof(MPDrawing), listView1,
                                      (DataTemplate)FindResource("HeaderTemplateSortNon"), dict);

            c.ShowDialog();
            AddSortBinding();
        }
Ejemplo n.º 12
0
 void InitializeColumnChooserPopup()
 {
     chooserWindow                    = new ColumnChooser(this.AssociatedObject.dataGrid);
     chooserWindow.Width              = 200;
     chooserWindow.Height             = 220;
     chooserWindow.TitleBarBackground = Brushes.LightGray;
     chooserWindow.Resources.MergedDictionaries.Clear();
     chooserWindow.ClearValue(ColumnChooser.StyleProperty);
     SfSkinManager.SetVisualStyle(chooserWindow, VisualStyles.MaterialLight);
     chooserWindow.Resources.MergedDictionaries.Add(this.AssociatedObject.MainGrid.Resources.MergedDictionaries[0]);
     this.AssociatedObject.dataGrid.GridColumnDragDropController = new GridColumnChooserController(this.AssociatedObject.dataGrid, chooserWindow);
     chooserWindow.Show();
     chooserWindow.Owner    = this.AssociatedObject;
     chooserWindow.Closing += chooserWindow_Closing;
 }
Ejemplo n.º 13
0
        public void CheckInvalidFkSelection()
        {
            var cc = new ColumnChooser <Image>(_fakeDb, new List <string>(), null);

            Assert.That(() => cc.ForginKey <Users>(), Throws.Exception.TypeOf <InvalidOperationException>());
        }