Ejemplo n.º 1
0
        private void _servicesView_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            if (_isLoaded && e.ColumnIndex == 0)
            {
                Service service = _servicesView.Rows[e.RowIndex].Tag as Service;
                string  newName = _servicesView["ServiceNameColumn", e.RowIndex].Value != null ? _servicesView["ServiceNameColumn", e.RowIndex].Value.ToString() : string.Empty;
                if (service != null)
                {
                    service.Name = newName;
                }
                else
                {
                    service = PriceManager.AddService(newName);
                    _servicesView.Rows[e.RowIndex].Tag = service;
                }

                ValidateCells(null);
            }
        }