コード例 #1
0
        /// <summary>
        /// CTor
        /// </summary>
        public CustomerSelector(INorthwindService service)
        {
            InitializeComponent();

            // get all customers
            _allCustomers = service.GetAllCustomers();
            // bind to grid.
            customersDataGrid.DataSource = _allCustomers;

            if (_allCustomers.Count > 0)
            {
                // there are customers, enable select button
                selectButton.Enabled = true;

                // select first row.
                customersDataGrid.Select(0);
            }
        }