protected void Grid_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
    {
        int c1 = Convert.ToInt32(e.GetValue("C1"));

        if (e.DataColumn.FieldName != "C1")
        {
            return;
        }
        e.Cell.Attributes.Add("fieldName", e.DataColumn.FieldName);
        if (c1 > 0)
        {
            e.Cell.ForeColor = System.Drawing.Color.Orange;
        }
        else
        {
            e.Cell.ForeColor = System.Drawing.Color.Blue;
        }
    }
        protected void KeyMobileDevicesGrid_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
        {
            string status = e.GetValue("Status").ToString();

            if (e.DataColumn.FieldName == "Status")
            {
                if (status == "Overdue")
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                    e.Cell.ForeColor = System.Drawing.Color.White;
                }
                else
                {
                    e.Cell.BackColor = System.Drawing.Color.LightGreen;
                    e.Cell.ForeColor = System.Drawing.Color.Black;
                }
            }
        }
Exemple #3
0
        protected void DAGStatusGridView_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
        {
            string status = "";

            status = e.GetValue("Status").ToString();
            switch (e.DataColumn.FieldName)
            {
            case "Status":
                if ((status.ToUpper()).Contains("FAIL"))
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                    e.Cell.ForeColor = System.Drawing.Color.White;
                }
                else if (status.ToUpper() == "ISSUE")
                {
                    e.Cell.BackColor = System.Drawing.Color.Yellow;
                }
                else if (status.ToUpper() == "OK" || status.ToUpper() == "PASS" || status.ToUpper() == "PASSED")
                {
                    e.Cell.BackColor = System.Drawing.Color.LightGreen;
                }
                break;
            }
        }
 protected void gridDanhSachKH_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.GetValue("CongNo").ToString() != "0" && e.GetValue("HanMucCongNo").ToString() != "0")
     {
         if (double.Parse(e.GetValue("CongNo").ToString()) > double.Parse(e.GetValue("HanMucCongNo").ToString()))
         {
             e.Cell.Attributes.Add("onclick", "ShowPopup('" + e.Cell.ClientID + "','1-" + e.KeyValue + "')");
         }
     }
     if (e.DataColumn.FieldName == "ThoiHanThanhToan" && e.GetValue("ThoiHanThanhToan").ToString() != "0")
     {
         int IDKhachHang = int.Parse(e.KeyValue.ToString());
         int ThoiHanTT   = int.Parse(e.GetValue("ThoiHanThanhToan").ToString());
         var PhieuGH     = DBDataProvider.DB.ghPhieuGiaoHangs.Where(x => x.KhachHangID == IDKhachHang && x.TTThanhToan == 0 && SqlMethods.DateDiffDay(x.NgayDuyet, DateTime.Now) > ThoiHanTT).ToList();
         if (PhieuGH.Count > 0)
         {
             e.Cell.BackColor = System.Drawing.Color.LightPink;
             e.Cell.ForeColor = System.Drawing.Color.DarkRed;
             e.Cell.Text      = PhieuGH.Count + " phiếu trễ";
             e.Cell.Attributes.Add("onclick", "ShowPopup('" + e.Cell.ClientID + "','2-" + e.KeyValue + "')");
         }
     }
 }
Exemple #5
0
 protected void gridView_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridViewTableDataCellEventArgs e)
 {
     e.Cell.Attributes.Add("onmouseover", string.Format("onShowPopup(event.x, event.y, '{0}')", e.GetValue("Description")));
 }