Exemplo n.º 1
0
 /// <summary>
 /// Change brackround color of current selection
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripButtonBackgroundColor_Click(object sender, EventArgs e)
 {
     SourceGrid.RangeRegion        region = grid1.Selection.GetSelectionRegion();
     SourceGrid.PositionCollection poss   = region.GetCellsPositions();
     for (int i = 0; i < poss.Count; ++i)
     {
         SourceGrid.Cells.Cell cell = grid1.GetCell(poss[i]) as SourceGrid.Cells.Cell;
         if (cell != null)
         {
             cell.View.BackColor = backgroundColor;
             grid1.PerformLayout();
         }
     }
 }