Пример #1
0
        public Form1()
        {
            InitializeComponent();

            categoriesFluentGrid =
                new FluentGrid <Category>(masterGrid)
                .AsNumber(c => c.Id, col => col.Width        = 30)
                .AsText(c => c.Title, col => col.Width       = 150)
                .AsText(c => c.Description, col => col.Width = 150)
                .AsText(c => c.Products, col => col.Visible  = false)
                .SelectionChanged(c => productsFluentGrid.Populate(c.Products))
                .Initialize();

            categoriesFluentGrid.Populate(GetRandomData());

            productsFluentGrid =
                new FluentGrid <Product>(detailsGrid)
                .AsNumber(p => p.Id, col => col.Width          = 30)
                .AsText(p => p.Title, col => col.Width         = 150)
                .AsText(p => p.Description, col => col.Width   = 150)
                .AsNumber(p => p.Price, col => col.Width       = 100)
                .AsText(p => p.Created, col => col.Width       = 100)
                .FormatCell(p => p.Created, cell => cell.Value = ((DateTime)cell.Value).ToShortDateString())
                .Initialize();
        }
Пример #2
0
        public Form1()
        {
            InitializeComponent();

            categoriesFluentGrid =
                new FluentGrid<Category>(masterGrid)
                    .AsNumber(c => c.Id, col => col.Width = 30)
                    .AsText(c => c.Title, col => col.Width = 150)
                    .AsText(c => c.Description, col => col.Width = 150)
                    .AsText(c => c.Products, col => col.Visible = false)
                    .SelectionChanged(c => productsFluentGrid.Populate(c.Products))
                    .Initialize();

            categoriesFluentGrid.Populate(GetRandomData());

            productsFluentGrid =
                new FluentGrid<Product>(detailsGrid)
                    .AsNumber(p => p.Id, col => col.Width = 30)
                    .AsText(p => p.Title, col => col.Width = 150)
                    .AsText(p => p.Description, col => col.Width = 150)
                    .AsNumber(p => p.Price, col => col.Width = 100)
                    .AsText(p => p.Created, col => col.Width = 100)
                    .FormatCell(p => p.Created, cell => cell.Value = ((DateTime)cell.Value).ToShortDateString())
                    .Initialize();
        }