Example #1
0
 private object SummColumn(int index, SummType param)
 {
     if (param == SummType.Count)
     {
         int count = 0;
         foreach (DataGridViewRow row in dgv.Rows)
         {
             if (row.Visible)
             {
                 count++;
             }
         }
         return count;
     }
     if (param == SummType.Value)
     {
         int summ = 0;
         foreach (DataGridViewRow row in dgv.Rows)
         {
             if (row.Visible)
             {
                 if (row.Cells[index].Value.ToString() != ""){
                     summ += Convert.ToInt32(row.Cells[index].Value.ToString());
                 }
             }
         }
         return summ;
     }
     return null;
 }
Example #2
0
 private object SummColumn(DataGridViewColumn column, SummType param)
 {
     return SummColumn(column.Index, param);
 }
Example #3
0
 private object SummColumn(string ColumnName, SummType param)
 {
     return SummColumn(dgv.Columns[ColumnName], param);
 }