Subscribe to web2feel.com
Subscribe to web2feel.com

Row Color in Grid Control C#

Diposting oleh Unknown Selasa, 28 Juni 2016

private void gridView1_RowStyle(object sender, RowStyleEventArgs e)
        {
            var view = sender as GridView;
            if (e.RowHandle < 0) return;
            var str = view.GetRowCellDisplayText(e.RowHandle, view.Columns["last_login"]);
            if (!string.IsNullOrEmpty(str))
            {
               if (str== DateTime.Now)
                {
                   
                    e.Appearance.BackColor = Color.Blue;
                    e.Appearance.BackColor2 = Color.White;
                }
            }
           
        }