public Form1()
        {
            InitializeComponent();
            orderInfo = new OrderInfoCollection();
            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalDigits     = 0;
            nfi.NumberGroupSizes        = new int[] { };
            this.sfDataGrid1.DataSource = orderInfo.OrdersListDetails;
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID", NumberFormatInfo = nfi
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;

            numberFormat.CurrencyDecimalDigits = 0;
            numberFormat.CurrencyGroupSizes    = new int[] { };

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName      = "UnitPrice",
                HeaderText       = "Unit Price",
                FormatMode       = FormatMode.Currency,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.NumberDecimalDigits = 0;
            numberFormat.NumberGroupSizes    = new int[] { };
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                HeaderText       = "Quantity",
                MappingName      = "Quantity",
                FormatMode       = FormatMode.Numeric,
                NumberFormatInfo = numberFormat
            });

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Discount", HeaderText = "Discount", FormatMode = FormatMode.Percent
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "ShipCountry", HeaderText = "Ship Country"
            });
            this.sfDataGrid1.Columns.Add(new GridComboBoxColumn()
            {
                MappingName = "ShipCityID", HeaderText = "Ship City", DisplayMember = "ShipCityName", ValueMember = "ShipCityID", DropDownStyle = DropDownStyle.DropDownList, DataSource = orderInfo.ShipCityDetails
            });

            this.sfDataGrid1.CellComboBoxSelectionChanged += sfDataGrid1_CellComboBoxSelectionChanged;
        }
Esempio n. 2
0
        public Form1()
        {
            InitializeComponent();
            orderInfo = new OrderInfoCollection();
            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalDigits     = 0;
            nfi.NumberGroupSizes        = new int[] { };
            this.sfDataGrid1.DataSource = orderInfo.OrdersListDetails;
            this.sfDataGrid1.Columns.Add(new GridCheckBoxColumn()
            {
                MappingName = "IsClosed", HeaderText = "Closed", AllowCheckBoxOnHeader = true, CheckBoxSize = new Size(14, 14), Width = 100
            });

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID", NumberFormatInfo = nfi
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "ContactNumber", HeaderText = "Contact Number"
            });
            this.sfDataGrid1.Columns["ContactNumber"].CellStyle.HorizontalAlignment = HorizontalAlignment.Right;
            NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;

            numberFormat.CurrencyDecimalDigits = 0;
            numberFormat.CurrencyGroupSizes    = new int[] { };

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName      = "UnitPrice",
                HeaderText       = "Unit Price",
                FormatMode       = FormatMode.Currency,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.NumberDecimalDigits = 0;
            numberFormat.NumberGroupSizes    = new int[] { };
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                HeaderText       = "Quantity",
                MappingName      = "Quantity",
                FormatMode       = FormatMode.Numeric,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.PercentDecimalDigits = 0;
            numberFormat.NumberGroupSizes     = new int[] { };
        }
Esempio n. 3
0
        public Form1()
        {
            InitializeComponent();
            orderInfo = new OrderInfoCollection();
            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalDigits     = 0;
            nfi.NumberGroupSizes        = new int[] { };
            this.sfDataGrid1.DataSource = orderInfo.OrdersListDetails;
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID", NumberFormatInfo = nfi
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;

            numberFormat.CurrencyDecimalDigits = 0;
            numberFormat.CurrencyGroupSizes    = new int[] { };

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName      = "UnitPrice",
                HeaderText       = "Unit Price",
                FormatMode       = FormatMode.Currency,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.PercentDecimalDigits = 0;
            numberFormat.NumberGroupSizes     = new int[] { };
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Discount", HeaderText = "Discount", FormatMode = FormatMode.Percent, NumberFormatInfo = numberFormat
            });
            this.sfDataGrid1.Columns.Add(new GridHyperlinkColumn()
            {
                MappingName = "Hyperlink", HeaderText = "Order URI"
            });
            this.sfDataGrid1.Columns.Add(new GridComboBoxColumn()
            {
                MappingName = "ShipCityID", HeaderText = "Ship City", DisplayMember = "ShipCityName", ValueMember = "ShipCityID", DropDownStyle = DropDownStyle.DropDownList, DataSource = orderInfo.ShipCityDetails
            });
            this.sfDataGrid1.Columns.Add(new GridMultiSelectComboBoxColumn()
            {
                MappingName = "Products", HeaderText = "Products", DisplayMember = "ProductName", ValueMember = "ProductName", DataSource = orderInfo.ProductDetails
            });

            //Event subscription
            this.sfDataGrid1.DrawCell += SfDataGrid1_DrawCell;
        }
Esempio n. 4
0
        public Form1()
        {
            InitializeComponent();
            orderInfo = new OrderInfoCollection();
            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalDigits     = 0;
            nfi.NumberGroupSizes        = new int[] { };
            this.sfDataGrid1.DataSource = orderInfo.OrdersListDetails;
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID", NumberFormatInfo = nfi
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "ContactNumber", HeaderText = "Contact Number"
            });
            NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;

            numberFormat.CurrencyDecimalDigits = 0;
            numberFormat.CurrencyGroupSizes    = new int[] { };

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName      = "UnitPrice",
                HeaderText       = "Unit Price",
                FormatMode       = FormatMode.Currency,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.NumberDecimalDigits = 0;
            numberFormat.NumberGroupSizes    = new int[] { };
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                HeaderText       = "Quantity",
                MappingName      = "Quantity",
                FormatMode       = FormatMode.Numeric,
                NumberFormatInfo = numberFormat
            });

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Discount", HeaderText = "Discount", FormatMode = FormatMode.Percent
            });
            this.sfDataGrid1.Columns.Add(new GridDateTimeColumn()
            {
                MappingName = "OrderDate", HeaderText = "Order Date", FilterMode = ColumnFilter.DisplayText
            });
            this.sfDataGrid1.Columns.Add(new GridHyperlinkColumn()
            {
                MappingName = "Hyperlink", HeaderText = "Order URI"
            });
            this.sfDataGrid1.Columns.Add(new GridImageColumn()
            {
                MappingName = "Images", HeaderText = "Country"
            });
            this.sfDataGrid1.Columns.Add(new GridCheckBoxColumn()
            {
                MappingName = "IsClosed", HeaderText = "Closed"
            });
            this.sfDataGrid1.Columns.Add(new GridComboBoxColumn()
            {
                MappingName = "ShipCityID", HeaderText = "Ship City", DisplayMember = "ShipCityName", ValueMember = "ShipCityID", DropDownStyle = DropDownStyle.DropDownList, DataSource = orderInfo.ShipCityDetails
            });

            (this.sfDataGrid1.Columns["Images"] as GridImageColumn).ImageLayout = ImageLayout.Center;
            (this.sfDataGrid1.Columns["Images"] as GridImageColumn).CellStyle.VerticalAlignment   = VerticalAlignment.Center;
            (this.sfDataGrid1.Columns["Images"] as GridImageColumn).CellStyle.HorizontalAlignment = HorizontalAlignment.Center;
        }
Esempio n. 5
0
        public Form1()
        {
            InitializeComponent();
            orderInfo = new OrderInfoCollection();
            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalDigits     = 0;
            nfi.NumberGroupSizes        = new int[] { };
            this.sfDataGrid1.DataSource = orderInfo.OrdersListDetails;
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID", NumberFormatInfo = nfi
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "ContactNumber", HeaderText = "Contact Number"
            });
            this.sfDataGrid1.Columns["ContactNumber"].CellStyle.HorizontalAlignment = HorizontalAlignment.Right;
            NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;

            numberFormat.CurrencyDecimalDigits = 0;
            numberFormat.CurrencyGroupSizes    = new int[] { };

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName      = "UnitPrice",
                HeaderText       = "Unit Price",
                FormatMode       = FormatMode.Currency,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.NumberDecimalDigits = 0;
            numberFormat.NumberGroupSizes    = new int[] { };
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                HeaderText       = "Quantity",
                MappingName      = "Quantity",
                FormatMode       = FormatMode.Numeric,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.PercentDecimalDigits = 0;
            numberFormat.NumberGroupSizes     = new int[] { };
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Discount", HeaderText = "Discount", FormatMode = FormatMode.Percent, NumberFormatInfo = numberFormat
            });
            this.sfDataGrid1.Columns.Add(new GridDateTimeColumn()
            {
                MappingName = "OrderDate", HeaderText = "Order Date", FilterMode = ColumnFilter.DisplayText
            });
            this.sfDataGrid1.Columns.Add(new GridHyperlinkColumn()
            {
                MappingName = "Hyperlink", HeaderText = "Order URI"
            });
            this.sfDataGrid1.Columns.Add(new GridCheckBoxColumn()
            {
                MappingName = "IsClosed", HeaderText = "Closed", AllowCheckBoxOnHeader = true, CheckBoxSize = new Size((int)DpiAware.LogicalToDeviceUnits(14.0f), (int)DpiAware.LogicalToDeviceUnits(14.0f)), Width = 100
            });
            this.sfDataGrid1.Columns.Add(new GridComboBoxColumn()
            {
                MappingName = "ShipCityID", HeaderText = "Ship City", DisplayMember = "ShipCityName", ValueMember = "ShipCityID", DropDownStyle = DropDownStyle.DropDownList, DataSource = orderInfo.ShipCityDetails
            });
            this.sfDataGrid1.Columns.Add(new GridMultiSelectComboBoxColumn()
            {
                MappingName = "Products", HeaderText = "Products", DisplayMember = "ProductName", ValueMember = "ProductName", DataSource = orderInfo.ProductDetails
            });
        }
        public Form1()
        {
            InitializeComponent();
            orderInfo = new OrderInfoCollection();
            NumberFormatInfo nfi = new NumberFormatInfo();

            nfi.NumberDecimalDigits     = 0;
            nfi.NumberGroupSizes        = new int[] { };
            this.sfDataGrid1.DataSource = orderInfo.OrdersListDetails;
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "OrderID", HeaderText = "Order ID", NumberFormatInfo = nfi
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "CustomerID", HeaderText = "Customer ID"
            });
            this.sfDataGrid1.Columns.Add(new GridTextColumn()
            {
                MappingName = "ContactNumber", HeaderText = "Contact Number"
            });
            NumberFormatInfo numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;

            numberFormat.CurrencyDecimalDigits = 0;
            numberFormat.CurrencyGroupSizes    = new int[] { };

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName      = "UnitPrice",
                HeaderText       = "Unit Price",
                FormatMode       = FormatMode.Currency,
                NumberFormatInfo = numberFormat
            });

            numberFormat = Application.CurrentCulture.NumberFormat.Clone() as NumberFormatInfo;
            numberFormat.NumberDecimalDigits = 0;
            numberFormat.NumberGroupSizes    = new int[] { };
            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                HeaderText       = "Quantity",
                MappingName      = "Quantity",
                FormatMode       = FormatMode.Numeric,
                NumberFormatInfo = numberFormat
            });

            this.sfDataGrid1.Columns.Add(new GridNumericColumn()
            {
                MappingName = "Discount", HeaderText = "Discount", FormatMode = FormatMode.Percent
            });
            this.sfDataGrid1.Columns.Add(new GridDateTimeColumn()
            {
                MappingName = "OrderDate", HeaderText = "Order Date", FilterMode = ColumnFilter.DisplayText
            });
            this.sfDataGrid1.Columns.Add(new GridCheckBoxColumn()
            {
                MappingName = "IsClosed", HeaderText = "Is Closed"
            });
            this.sfDataGrid1.Columns.Add(new GridCheckBoxColumn()
            {
                MappingName = "ClosedStatus", HeaderText = "Closed Status"
            });

            this.sfDataGrid1.CellCheckBoxClick += sfDataGrid1_CellCheckBoxClick;

            this.sfDataGrid1.CurrentCellActivating += sfDataGrid1_CurrentCellActivating;
        }