예제 #1
0
 public static void DataGridView_LockColumn(DataGridViewProperties dataGridViewProperties, String name)
 {
     int index = dataGridViewProperties.IndexOf(name);
     if (index > -1 && index < dataGridViewProperties.dataGridView.Columns.Count)
     {
         DataGridViewColumn readOnlyColumn = dataGridViewProperties.dataGridView.Columns[index];
         readOnlyColumn.ReadOnly = true;
         readOnlyColumn.DefaultCellStyle.BackColor = Color.WhiteSmoke;
     }
 }
예제 #2
0
 public static float dataGridView_ColumnSum(DataGridViewProperties properties, String name)
 {
     float sum = 0F;
     foreach (DataGridViewRow row in properties.dataGridView.Rows)
     {
         float number = 0;
         float.TryParse(row.Cells[properties.IndexOf(name)].Value.ToString(), out number);
         sum += number;
     }
     return sum;
 }