コード例 #1
0
 protected void grid_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex == 0)
     {
         e.Row.BackColor = System.Drawing.Color.LightGreen;
     }
 }
コード例 #2
0
 protected void gridTonKhoBanDau_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     //Color color = (Color)ColorTranslator.FromHtml("#FF9797");
     //int TonKhoTong = Convert.ToInt32(e.GetValue("SoLuongCon"));
     //if (TonKhoTong < 6)
     //    e.Row.BackColor = color;
 }
コード例 #3
0
        /// <summary>
        /// This method fires when each row in the all users DevExpress GridView is data bound
        /// and it shows/hides buttons and sets popover information
        /// </summary>
        /// <param name="sender">The GridViewRow inside bsGRUsers</param>
        /// <param name="e">The ASPxGridViewTableRowEventArgs</param>
        protected void bsGRUsers_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            //Only work on data rows
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                LinkButton  disableButton, enableButton;
                Label       emailLabel, phoneLabel;
                PyramidUser user;

                //Get the user that the row is for
                using (ApplicationDbContext context = new ApplicationDbContext())
                {
                    user = context.Users.Find(e.GetValue("Id"));
                }

                //Get the necessary controls
                disableButton = (LinkButton)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lbDisableUser");
                enableButton  = (LinkButton)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lbEnableUser");
                emailLabel    = (Label)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lblEmail");
                phoneLabel    = (Label)bsGRUsers.FindRowCellTemplateControl(e.VisibleIndex, null, "lblPhone");

                //Show/hide the enable and disable buttons
                if (user.LockoutEndDateUtc.HasValue && user.LockoutEndDateUtc.Value > DateTime.Now)
                {
                    disableButton.Visible = false;
                    enableButton.Visible  = true;
                }
                else
                {
                    disableButton.Visible = true;
                    enableButton.Visible  = false;
                }

                //Set the CSS class and popover for the email
                if (user.EmailConfirmed)
                {
                    emailLabel.CssClass = "text-success";
                    emailLabel.Attributes.Add("data-content", "Email is confirmed!");
                }
                else
                {
                    emailLabel.CssClass = "text-custom-warning";
                    emailLabel.Attributes.Add("data-content", "Email is not confirmed!");
                }

                //Set the CSS class and popover for the phone
                if (user.PhoneNumberConfirmed)
                {
                    phoneLabel.CssClass = "text-success";
                    phoneLabel.Attributes.Add("data-content", "Phone is confirmed!");
                }
                else
                {
                    phoneLabel.CssClass = "text-custom-warning";
                    phoneLabel.Attributes.Add("data-content", "Phone is not confirmed!");
                }
            }
        }
コード例 #4
0
 protected void ASPxGridView_show_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     if (ASPxGridView_show.VisibleRowCount > 0)
     {
         if (e.GetValue("系统存放地点").ToString() != e.GetValue("盘点存放地点").ToString())
         {
             e.Row.BackColor = System.Drawing.Color.LemonChiffon;
         }
     }
 }
コード例 #5
0
        protected void gridPhanQuyen_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            Color  color     = (Color)ColorTranslator.FromHtml("#FF9797");
            string TrangThai = Convert.ToString(e.GetValue("Link"));

            if (TrangThai == "")
            {
                e.Row.BackColor = color;
            }
        }
コード例 #6
0
        protected void gridDanhSach_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            Color color            = (Color)ColorTranslator.FromHtml("#FF9797");
            int   TrangThaiDonHang = Convert.ToInt32(e.GetValue("TrangThaiDonHang"));

            if (TrangThaiDonHang == 1)
            {
                e.Row.BackColor = color;
            }
        }
コード例 #7
0
ファイル: QuickrHealth.aspx.cs プロジェクト: ImranVS/SVNGIT
        protected void QuickrServersGrid_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            int index = QuickrServersGrid.FocusedRowIndex;

            if (e.VisibleIndex != index)
            {
                e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';");

                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");
            }
        }
コード例 #8
0
        protected void gridDonDatHang_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            Color color       = (Color)ColorTranslator.FromHtml("#FF9797");
            int   MucDoUuTien = Convert.ToInt32(e.GetValue("MucDoUuTien"));// lấy giá trị
            int   TrangThai   = Convert.ToInt32(e.GetValue("TrangThai"));

            if (MucDoUuTien == 1 && TrangThai == 0)
            {
                e.Row.BackColor = color;
            }
        }
    protected void gridProducts_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
    {
        if (e.VisibleIndex != gridProducts.EditingRowVisibleIndex)
        {
            return;
        }
        TableCell cell = e.Row.Cells[0];

        cell.Controls.Clear();
        cell.Controls.Add(CreateHyperlink("Update", "OnProductUpdate();"));
        cell.Controls.Add(CreateHyperlink("Cancel", "gridProducts.CancelEdit();"));
    }
コード例 #10
0
        /// <summary>
        /// This method fires when the TPITOS GridView prepares a row
        /// and it highlights invalid TPITOS observations
        /// </summary>
        /// <param name="sender">The bsGRTPITOS Bootstrap GridView</param>
        /// <param name="e">The ASPxGridViewTableRowEvent event arguments</param>
        protected void bsGRTPITOS_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            //Evaluate only data rows
            if (e.RowType == DevExpress.Web.GridViewRowType.Data)
            {
                //Determine if this row represents a valid TPITOS
                bool isTPITOSValid = Convert.ToBoolean(e.GetValue("IsValid"));

                if (!isTPITOSValid)
                {
                    //The TPITOS is not valid, add the CSS class
                    e.Row.CssClass = "invalid-tpitos";
                }
            }
        }
コード例 #11
0
    protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
    {
        int rowCount = Convert.ToInt32(ASPxGridView1.GetGroupSummaryValue(e.VisibleIndex, ASPxGridView1.GroupSummary[0]));

        if (e.RowType == DevExpress.Web.GridViewRowType.Group)
        {
            if (rowCount > 10)
            {
                e.Row.BackColor = System.Drawing.Color.Red;
            }
            else
            {
                e.Row.BackColor = System.Drawing.Color.Green;
            }
        }
    }
コード例 #12
0
    protected void griddevice_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
    {
        int            id      = Convert.ToInt32(e.GetValue("idud"));
        string         sql     = "select * from tblEntrance where statusdoor='None' and idud=" + id;
        SqlDataAdapter adapter = new SqlDataAdapter(sql, strcon);
        DataTable      data    = new DataTable();

        adapter.Fill(data);
        if (data.Rows.Count > 0)
        {
            e.Row.BackColor = System.Drawing.Color.Orange;
        }

        //sql = "select * from tblEntrance where statusdoor='None' and idud=" + id;
        //SqlDataAdapter adapter2 = new SqlDataAdapter(sql, strcon);
        //DataTable data2 = new DataTable();
        //adapter2.Fill(data2);
        //if (data2.Rows.Count > 0)
        //{
        //    e.Row.BackColor = System.Drawing.Color.Orange;
        //}
        // int id = Convert.ToInt32(e.GetValue("idud"));
        // string sql = "select * from tblEntrance where iduser not in (select e.iduser from tblEntrance e inner join tblDeviceUser d on e.iduser=d.iduser) and iddevice=" + Convert.ToInt32(lbliddevice.Text) + " and idud=" + id ;
        //SqlDataAdapter adapter = new SqlDataAdapter(sql, strcon);
        //DataTable data = new DataTable();
        //adapter.Fill(data);
        //if (data.Rows.Count > 0)
        //{
        //    e.Row.BackColor = System.Drawing.Color.Orange;
        //}

        //sql = "select * from tblEntrance where iduser is null and idud=" + id ;
        //SqlDataAdapter adapter2 = new SqlDataAdapter(sql, strcon);
        //DataTable data2 = new DataTable();
        //adapter2.Fill(data2);
        //if (data2.Rows.Count > 0)
        //{
        //    e.Row.BackColor = System.Drawing.Color.Orange;
        //}
    }
コード例 #13
0
        protected void MaintWinListGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0C0';");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white';");
        }
コード例 #14
0
ファイル: QuickrHealth.aspx.cs プロジェクト: ImranVS/SVNGIT
        protected void QuickrPlacesGrid_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
        {
            e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';");

            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;");
        }
 protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     e.Row.BackColor = (Color)e.GetValue("ItemColor");
 }
 protected void gridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
     // Thread.Sleep(100);
 }
コード例 #17
0
 protected void gridTonKhoBanDau_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e)
 {
 }