Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. private void days(object sender, DataGridViewCellFormattingEventArgs e)
  2. {
  3. var senderGrid = (DataGridView)sender;
  4. if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
  5. {
  6. var c = SmanArea.Rows[e.RowIndex].Cells[e.ColumnIndex];
  7. if (c.Value.ToString() == "1" && c is DataGridViewButtonCell)
  8. {
  9. c.Style.BackColor = Color.LightGreen;
  10. }
  11. else
  12. {
  13. c.Style.BackColor = Color.RosyBrown;
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement