Esempio n. 1
0
    //end grid call back
    /// <summary>
    /// javascript added to rows on the fly so we can track what has been ticked
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void dxgdvOrder_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            DevExpress.Web.ASPxGridView.ASPxGridView _grid = (DevExpress.Web.ASPxGridView.ASPxGridView)sender;
            //string _hfKey = "key" + e.KeyValue.ToString(); //this seems to be problematic (string too big for key??)
            //string _hfKey = "key" + e.GetValue("OrderID").ToString();
            string _hfKey = "orderidkey";

            //find order id
            //string _test = e.GetValue("OrderID").ToString();

            //find template controls
            DevExpress.Web.ASPxGridView.GridViewDataColumn _col1 = (DevExpress.Web.ASPxGridView.GridViewDataColumn)_grid.Columns["chkcustom"];
            DevExpress.Web.ASPxEditors.ASPxCheckBox        _chk  = (DevExpress.Web.ASPxEditors.ASPxCheckBox)_grid.FindRowCellTemplateControl(e.VisibleIndex, _col1, "dxchktick");
            //var _chk = (DevExpress.Web.ASPxGridView.Rendering.GridViewTableCommandCell)e.Row.Cells[0];
            //and pass data from hidden field if it's stored - make sure text box is ticked
            if (_chk != null)
            {
                _chk.ClientSideEvents.CheckedChanged = "function(s,e){rowTicked(" + e.GetValue("OrderID") + "," + e.GetValue("OrderNumber") + ");}";

                if (this.dxhfsource.Contains(_hfKey))
                {
                    if (this.dxhfsource.Get("orderidkey").ToString() == e.GetValue("OrderID").ToString())
                    {
                        _chk.Checked = true;
                    }
                }
            }
        }
    }
Esempio n. 2
0
 protected void gvDetailDiskonJasa2_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
         e.Row.Cells[0].Text = ((e.VisibleIndex) + 1).ToString();
     }
 }
Esempio n. 3
0
 protected void ASPxGridView1_HtmlRowPrepared(object s, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     //    int lessonid =Convert.ToInt32(e.GetValue("Lesson_id"));
     //    Response.Write(lessonid);
     //  Response.Redirect("train_course_details.aspx?Lesson_id=" + lessonid);
     // Response.Redirect("train_course_select.aspx?Lesson_id=" + lessonid);
 }
Esempio n. 4
0
        protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.VisibleIndex < 0)
            {
                return;
            }
            string compFlag = e.GetValue("COMP_FLAG").ToString();

            switch (compFlag)
            {
            case "0":
                e.Row.BackColor = System.Drawing.Color.White;
                break;

            case "1":
                e.Row.BackColor = System.Drawing.Color.Red;
                break;

            case "2":
                e.Row.BackColor = System.Drawing.Color.Green;
                break;

            default:
                return;
            }
        }
Esempio n. 5
0
 protected void gvPengembalianKelebihan_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
         e.Row.Cells[0].Text = ((e.VisibleIndex) + 1).ToString();
     }
 }
Esempio n. 6
0
        protected void gvNotasPedido_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            int   codigoEstado = e.GetValue("codigoEstado") == null ? 0 : Convert.ToInt32(e.GetValue("codigoEstado"));
            Color color;

            switch (codigoEstado)
            {
            case Constantes.Estados.VIGENTE:
                color = Color.LightGreen;
                break;

            case Constantes.Estados.ENTREGADA:
                color = Color.Cyan;
                break;

            case Constantes.Estados.ANULADA:
                color = Color.LightGray;
                break;

            case Constantes.Estados.PROXIMA_VENCER:
                color = Color.Yellow;
                break;

            case Constantes.Estados.VENCIDA:
                color = Color.OrangeRed;
                break;

            default:
                color = Color.White;
                break;
            }

            e.Row.BackColor = color;
        }
Esempio n. 7
0
 protected void gv_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
         e.Row.Cells[0].Text = (Convert.ToInt32(e.VisibleIndex) + 1).ToString();
     }
 }
Esempio n. 8
0
 protected void gridKartuPiutang_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
         e.Row.Cells[0].Text = (e.VisibleIndex + 1).ToString();
     }
 }
Esempio n. 9
0
    protected void “аблицаЁлементы_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            return;
        }

        e.Row.Attributes.Add("Key", e.KeyValue.ToString());
    }
Esempio n. 10
0
        protected void gvItemsEntrega_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            bool isEliminada = Convert.IsDBNull(e.GetValue("isEliminada")) ? false : Convert.ToBoolean(e.GetValue("isEliminada"));

            if (isEliminada)
            {
                e.Row.BackColor = Color.Red;
            }
        }
Esempio n. 11
0
 protected void xgvPerson_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
     {
         return;
     }
     //当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色
     e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#ffffcd',this.style.fontWeight='';");
     //当鼠标离开的时候 将背景颜色还原的以前的颜色
     e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
 }
Esempio n. 12
0
 protected void gv_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
     {
         return;
     }
     if (e.VisibleIndex % 2 == 0)
     {
         e.Row.BackColor = System.Drawing.Color.Honeydew;
     }
 }
Esempio n. 13
0
 protected void grid_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.Data)
     {
         string closeInd = SafeValue.SafeString(this.grid.GetRowValues(e.VisibleIndex, "Status"));
         if (closeInd == "InActive")
         {
             e.Row.BackColor = System.Drawing.Color.LightBlue;
         }
     }
 }
Esempio n. 14
0
        protected void ASPxGridView3_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
            {
                return;
            }
            double s = Convert.ToDouble(e.GetValue("Grade"));

            if (s < 60 && s != 00)
            {
                e.Row.ForeColor = Color.Red;
            }
        }
Esempio n. 15
0
        protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            if (e.VisibleIndex < 0)
            {
                return;
            }
            string status = e.GetValue("ISTRUE").ToString(); //已确认绿色

            if (status == "1")
            {
                e.Row.BackColor = System.Drawing.Color.YellowGreen;
            }
        }
    protected void grid_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            return;
        }
        decimal value = (decimal)e.GetValue("Total");

        if (value > 1000)
        {
            e.Row.ForeColor = Color.Red;
        }
    }
    protected void grid_Transport_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        //if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return;

        //ASPxButtonEdit driver = this.grid_Transport.FindRowCellTemplateControl(e.VisibleIndex, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid_Transport.Columns["Driver"], "btn_DriverCode") as ASPxButtonEdit;
        //if (driver != null)
        //{
        //    driver.ClientInstanceName = driver.ClientInstanceName + e.VisibleIndex;
        //    ASPxButtonEdit towhead = this.grid_Transport.FindRowCellTemplateControl(e.VisibleIndex, (DevExpress.Web.ASPxGridView.GridViewDataColumn)this.grid_Transport.Columns["VehicleNo"], "btn_vehicle") as ASPxButtonEdit;
        //    towhead.ClientInstanceName = towhead.ClientInstanceName + e.VisibleIndex;
        //    driver.ClientSideEvents.ButtonClick = "function(s,e){" + string.Format("PopupCTM_Driver({0},null,{1},null);", driver.ClientInstanceName, towhead.ClientInstanceName) + "}";
        //    towhead.ClientSideEvents.ButtonClick = "function(s,e){" + string.Format("PopupCTM_MasterData({0},null,'Towhead');", towhead.ClientInstanceName) + "}";
        //}
    }
Esempio n. 18
0
    protected void grid_Transport_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            return;
        }
        ASPxButtonEdit driver = this.grid_Transport.FindRowTemplateControl(e.VisibleIndex, "btn_DriveCode") as ASPxButtonEdit;

        if (driver != null)
        {
            driver.ClientInstanceName = driver.ClientInstanceName + e.VisibleIndex;
            ASPxTextBox towhead = this.grid_Transport.FindRowTemplateControl(e.VisibleIndex, "txt_TowheadCode") as ASPxTextBox;
            towhead.ClientInstanceName = towhead.ClientInstanceName + e.VisibleIndex;
            ASPxTextBox ScheduleDate = this.grid_Transport.FindRowTemplateControl(e.VisibleIndex, "txt_ScheduleDate") as ASPxTextBox;
            driver.ClientSideEvents.ButtonClick = "function(s,e){" + string.Format("PopupCTM_DriverLog({0},null,{1},'{2}');", driver.ClientInstanceName, towhead.ClientInstanceName, ScheduleDate.Text) + "}";
        }
    }
Esempio n. 19
0
    protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
    {
        if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data)
        {
            return;
        }

        ASPxButtonEdit loc = this.ASPxGridView1.FindRowCellTemplateControl(e.VisibleIndex, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Loc"], "txt_Loc") as ASPxButtonEdit;

        if (loc != null)
        {
            loc.ClientInstanceName           = loc.ClientInstanceName + e.VisibleIndex;
            loc.ClientSideEvents.ButtonClick = "function(s,e){" + string.Format("PopupLo({0},null);", loc.ClientInstanceName) + "}";
            string location = SafeValue.SafeString(C2.Manager.ORManager.ExecuteScalar(string.Format("select top 1 Code from  ref_location where Loclevel='Unit'")));
            loc.Text = location;
        }
    }
Esempio n. 20
0
        protected void ASPxGridView1_Order_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            var itemDeadline = _OrderDeadlineRepo.GetById(Utils.CIntDef(e.KeyValue));

            if (itemDeadline != null && itemDeadline.STATUS != 1 && itemDeadline.ISCHECK != 1)
            {
                DateTime dateDeadline = Utils.CDateDef(itemDeadline.DEADLINE_DATE, DateTime.MinValue);
                int      d            = (dateDeadline.Date - DateTime.Now.Date).Days;
                if (d < 0)
                {
                    e.Row.ForeColor = Color.White;
                    e.Row.BackColor = Color.Red;
                }
                else if (d <= 10)
                {
                    e.Row.ForeColor = Color.Red;
                    e.Row.BackColor = Color.Yellow;
                }
            }
        }
        protected void ASPxGridView1_Order_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
        {
            var c = _OrderRepo.GetById(Utils.CIntDef(e.KeyValue));

            if (c != null && c.STATUS == 2)
            {
                var listDeadline = _OrderDeadlineRepo.GetByOrderId(Utils.CIntDef(e.KeyValue)).Where(n => n.STATUS != 1).OrderBy(n => n.ID);
                if (listDeadline != null && listDeadline.ToList().Count > 0 && listDeadline.ToList()[0].ISCHECK != 1)
                {
                    DateTime dateDeadline = Utils.CDateDef(listDeadline.ToList()[0].DEADLINE_DATE, DateTime.MinValue);
                    int      d            = (dateDeadline.Date - DateTime.Now.Date).Days;
                    if (d < 0)
                    {
                        e.Row.ForeColor = Color.White;
                        e.Row.BackColor = Color.Red;
                    }
                    else if (d <= 10)
                    {
                        e.Row.ForeColor = Color.Red;
                        e.Row.BackColor = Color.Yellow;
                    }
                }
            }
        }
Esempio n. 22
0
 protected void gridResellerGroups_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
 }
Esempio n. 23
0
 protected void gvPembayaran_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
     }
 }
Esempio n. 24
0
 protected void gvItemsEntrega_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
 }
 protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     e.Row.Attributes.Add("onclick", "onRowClick(" + e.VisibleIndex + ")");
 }
Esempio n. 26
0
 protected void grdExpried_HtmlRowCreated1(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#DEEDFF';");
     e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white';");
 }
Esempio n. 27
0
 protected void gridThanhVien_htmlRowCreated(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs e)
 {
     e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='pink';");
     e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white';");
 }