Gridview Seçili Hücrelerin Renklendiirlmesi

lusek

Şen Üye
Katılım
9 Şub 2011
Mesajlar
62
Beğeniler
0
Yaş
38
#1
if (e.RowHandle >= 0)
{
if (e.Column.Caption == "Pazar") { e.Appearance.BackColor = Color.AliceBlue; e.Appearance.ForeColor = Color.Black; }
if (e.Column.Caption == "Cumartesi") { e.Appearance.BackColor = Color.AliceBlue; e.Appearance.ForeColor = Color.Black; }
//if (GridViewPersonelPuantaj.IsCellSelected(e.RowHandle,e.Column)){}
}

if (e.Column.Caption == "Pazartesi" || e.Column.Caption == "Salı" || e.Column.Caption == "Çarşamba" || e.Column.Caption == "Perşembe" || e.Column.Caption == "Cuma")
{
string Kolon = GridViewPersonelPuantaj.GetRowCellDisplayText(e.RowHandle, GridViewPersonelPuantaj.Columns["Durum"]);
switch (Kolon)
{
case "DEVAMSIZ": e.Appearance.BackColor = Color.Red; e.Appearance.ForeColor = Color.Black; break;
case "RAPORLU": e.Appearance.BackColor = Color.Yellow; e.Appearance.ForeColor = Color.Black; break;
case "M.İZİNLİ": e.Appearance.BackColor = Color.LawnGreen; e.Appearance.ForeColor = Color.Black; break;
case "GÖREVLİ": e.Appearance.BackColor = Color.Aqua; e.Appearance.ForeColor = Color.Black; break;
case "SEVKLİ": e.Appearance.BackColor = Color.Blue; e.Appearance.ForeColor = Color.Black; break;
case "CEZALI": e.Appearance.BackColor = Color.Pink; e.Appearance.ForeColor = Color.Black; break;
case "NÖBETÇİ": e.Appearance.BackColor = Color.Purple; e.Appearance.ForeColor = Color.Black; break;
case "G.İZİNLİ": e.Appearance.BackColor = Color.Salmon; e.Appearance.ForeColor = Color.Black; break;
case "R.TATİL": e.Appearance.BackColor = Color.Silver; e.Appearance.ForeColor = Color.Black; break;
case "ARAZİ": e.Appearance.BackColor = Color.YellowGreen; e.Appearance.ForeColor = Color.Black; break;
case "": break;

default:

break;
}
}

Devamsizlik();
 

Bu konuyu okuyanlar (Üyeler: 1, Misafirler: 0)

Üst