private void btnCalc_Click(object sender, EventArgs e) { if ((cmbField.SelectedItem == null) || (cmbAggregateFunction.SelectedItem == null)) { return; } lblResult.Text = Convert.ToString(grid.GetTotal(cmbField.SelectedItem as GridEXColumn, (AggregateFunction)cmbAggregateFunction.SelectedItem)); }