示例#1
0
        protected void NodesGrid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "Alive")
            {
                if (e.GetValue("Alive").ToString() == "Yes")
                {
                    e.Cell.BackColor = System.Drawing.Color.LightGreen;
                }
                else if (e.GetValue("isDisabled").ToString() == "Yes")
                {
                    e.Cell.BackColor = System.Drawing.Color.Gray;
                    e.Cell.Text      = "DISABLED";
                }
                else
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                    e.Cell.ForeColor = System.Drawing.Color.White;
                }
            }

            if (e.DataColumn.FieldName == "isDisabled")
            {
                if (e.GetValue("isDisabled").ToString() == "No")
                {
                    e.Cell.BackColor = System.Drawing.Color.LightGreen;
                }
                else
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                    e.Cell.ForeColor = System.Drawing.Color.White;
                }
            }
        }
    protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
    {
        ASPxGridView grid = sender as ASPxGridView;

        e.Cell.Attributes["onclick"] = string.Format("OnCellClick({0}, {1}, {2}, event);",
                                                     grid.ClientInstanceName, e.VisibleIndex, e.DataColumn.VisibleIndex);
    }
示例#3
0
        protected void ExchangeMailGridView_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            ASPxGridView gv       = sender as ASPxGridView;
            Label        hfStatus = gv.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "hfExNameLabel") as Label;


            if (e.DataColumn.FieldName == "Status" && (hfStatus.Text.ToString() == "OK" || hfStatus.Text.ToString() == "Scanning" || hfStatus.Text.ToString() == "Telnet"))
            {
                e.Cell.BackColor = System.Drawing.Color.LightGreen;
            }

            else if (e.DataColumn.FieldName == "Status" && hfStatus.Text.ToString() == "Not Responding")
            {
                e.Cell.BackColor = System.Drawing.Color.Red;
                e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "Status" && hfStatus.Text.ToString() == "Not Scanned")
            {
                e.Cell.BackColor = System.Drawing.Color.FromName("#87CEEB");
                e.Cell.ForeColor = System.Drawing.Color.Black;
            }
            else if (e.DataColumn.FieldName == "Status" && hfStatus.Text.ToString() == "Disabled")
            {
                e.Cell.BackColor = System.Drawing.Color.FromName("#D0D0D0");
            }
            else if (e.DataColumn.FieldName == "Status" && hfStatus.Text.ToString() == "Maintenance")
            {
                e.Cell.BackColor = System.Drawing.Color.LightBlue;
            }
            else if (e.DataColumn.FieldName == "Status")
            {
                e.Cell.BackColor = System.Drawing.Color.Yellow;
            }
        }
示例#4
0
 protected void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.Caption == "Whs Location")
     {
         string closeInd = SafeValue.SafeString(this.grid.GetRowValues(e.VisibleIndex, "ViaWh"));
         if (closeInd == "Yes")
         {
             e.Cell.BackColor = System.Drawing.Color.Orange;
         }
     }
     if (e.DataColumn.Caption == "Type")
     {
         string closeInd = SafeValue.SafeString(this.grid.GetRowValues(e.VisibleIndex, "JobType"));
         if (closeInd == "OutBound")
         {
             e.Cell.BackColor = System.Drawing.Color.LightBlue;
         }
     }
     if (e.DataColumn.Caption == "Status")
     {
         string closeInd = SafeValue.SafeString(this.grid.GetRowValues(e.VisibleIndex, "WorkStatus"));
         if (closeInd == "Working")
         {
             e.Cell.BackColor = System.Drawing.Color.LightGreen;
         }
         if (closeInd == "Unsuccess")
         {
             e.Cell.BackColor = System.Drawing.Color.Red;
         }
     }
 }
 protected void lv_ThongTinSP_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "Unbound")
     {
         e.Cell.Text = (e.VisibleIndex + 1).ToString();
     }
 }
示例#6
0
 protected void lv_ThongTinSP_HtmlDataCellPrepared(ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "Unbound")
     {
         e.Cell.Text = (e.VisibleIndex + 1).ToString(CultureInfo.InvariantCulture);
     }
 }
示例#7
0
        protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            string status = e.GetValue("Status").ToString();

            if (e.DataColumn.FieldName == "")//|| e.DataColumn.Caption="")
            {
                if (status == "OK" || status == "Scanning")
                {
                    e.Cell.BackColor = System.Drawing.Color.LightGreen;
                }
                else if (status == "Not Responding")
                {
                    e.Cell.BackColor = System.Drawing.Color.Red;
                }
                else if (status == "Not Scanned")
                {
                    e.Cell.BackColor = System.Drawing.Color.FromName("#87CEEB");
                }
                else if (status == "disabled")
                {
                    e.Cell.BackColor = System.Drawing.Color.Gray;
                }
                else if (status == "Maintenance")
                {
                    e.Cell.BackColor = System.Drawing.Color.LightBlue;
                }
                else if (e.DataColumn.FieldName == "")
                {
                    e.Cell.BackColor = System.Drawing.Color.Yellow;
                }
            }
        }
示例#8
0
 protected void grdTraining_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     try
     {
         if (e.DataColumn.FieldName == "id")
         {
             ASPxLabel lblTime = grdTraining.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblTime") as ASPxLabel;
             lblTime.Text = objTraining.GetTraining(Int32.Parse(e.CellValue.ToString())).fromdate.ToShortDateString() + " -" + objTraining.GetTraining(Int32.Parse(e.CellValue.ToString())).todate.ToShortDateString();
         }
         if (e.DataColumn.FieldName == "employeeid")
         {
             ASPxLabel lblEmp = grdTraining.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblEmp") as ASPxLabel;
             lblEmp.Text = objEmployees.GetEmployees(Int32.Parse(e.CellValue.ToString())).fullname;
         }
         if (e.DataColumn.FieldName == "decision")
         {
             ASPxHyperLink hyperDowload = grdTraining.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "hyperDowload") as ASPxHyperLink;
             ASPxImage     imgFile      = grdTraining.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "imgFile") as ASPxImage;
             hyperDowload.Text = e.CellValue.ToString();
             if (e.GetValue("fileKem").ToString().Trim() != "")
             {
                 imgFile.ImageUrl         = DotNetNuke.Common.Globals.ApplicationPath + "/images/imgadmin/file.png";
                 hyperDowload.NavigateUrl = DotNetNuke.Common.Globals.ApplicationPath + "/images/FileQD/" + e.GetValue("fileKem").ToString();
             }
             else
             {
                 imgFile.Visible = false;
             }
         }
     }
     catch { }
 }
        protected void DiskHealthGrid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "Status" && (e.CellValue.ToString() == "OK" || e.CellValue.ToString() == "Scanning" || e.CellValue.ToString() == "Telnet"))
            {
                e.Cell.BackColor = System.Drawing.Color.LightGreen;
            }

            else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Not Responding")
            {
                e.Cell.BackColor = System.Drawing.Color.Red;
                e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Not Scanned")
            {
                e.Cell.BackColor = System.Drawing.Color.Blue;
                e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "Status" && e.CellValue.ToString() == "Disabled")
            {
                e.Cell.BackColor = System.Drawing.Color.FromName("#D0D0D0");
                //e.Cell.BackColor = System.Drawing.Color.Gray;
                // e.Cell.ForeColor = System.Drawing.Color.White;
            }
            else if (e.DataColumn.FieldName == "Status")
            {
                e.Cell.BackColor = System.Drawing.Color.Yellow;
                // e.DataColumn.GroupFooterCellStyle.ForeColor = System.Drawing.Color.Yellow;
            }
        }
示例#10
0
 protected void LogFileGridView_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     {
         if (SessionWrapper.LoggedUser.Calendar_id != null)
         {
             if (SessionWrapper.LoggedUser.Calendar_id != 1)// if He select Hijri calender
             {
                 if (e.DataColumn.FieldName != "Log_Date")
                 {
                     return;
                 }
                 else
                 {
                     DateTime date       = DateTime.Parse(e.CellValue.ToString());
                     string   Hijri_date = UC.ConvertDateCalendar(date, "Hijri", "ar-SA");
                     //new_date = UC.ConvertDateCalendar(date, "Gregorian", "en-US");
                     int index = Hijri_date.IndexOf(" ");
                     if (index > 0)
                     {
                         Hijri_date = Hijri_date.Substring(0, index);
                     }
                     e.Cell.Text = Hijri_date + " " + date.ToShortTimeString();
                 }
             }
         }
     }
 }
示例#11
0
 protected void ASPxgvRegions_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "RegionId")
     {
         e.Cell.Attributes.Add("onclick", "event.cancelBubble = true");
     }
 }
示例#12
0
 protected void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "empid")
     {
         ASPxLabel lblEmp = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblEmp") as ASPxLabel;
         if (objEmployees.GetEmployees(Int32.Parse(e.CellValue.ToString())) != null)
         {
             lblEmp.Text = objEmployees.GetEmployees(Int32.Parse(e.CellValue.ToString())).fullname;
         }
     }
     if (e.DataColumn.FieldName == "officeid")
     {
         Philip.Modules.Office.OfficeController objOffice = new Philip.Modules.Office.OfficeController();
         ASPxLabel lblOffice = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblOffice") as ASPxLabel;
         if (objOffice.GetOffice(Int32.Parse(e.CellValue.ToString())) != null)
         {
             lblOffice.Text = objOffice.GetOffice(Int32.Parse(e.CellValue.ToString())).name;
         }
     }
     if (e.DataColumn.FieldName == "statemanagementid")
     {
         VNPT.Modules.StateManagement.StateManagementController objSate = new VNPT.Modules.StateManagement.StateManagementController();
         ASPxLabel lblState = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblState") as ASPxLabel;
         if (objSate.GetStateManagement(Int32.Parse(e.CellValue.ToString())) != null)
         {
             lblState.Text = objSate.GetStateManagement(Int32.Parse(e.CellValue.ToString())).name;
         }
     }
 }
示例#13
0
 protected void grid_Transport_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "Date1")
     {
         DateTime dtime     = SafeValue.SafeDate(e.CellValue, new DateTime(1990, 1, 1));
         DateTime dtime_now = DateTime.Now;
         if (dtime_now.AddDays(5).CompareTo(dtime) > 0)
         {
             e.Cell.BackColor = System.Drawing.Color.Red;
         }
         else
         {
             if (dtime_now.AddDays(30).CompareTo(dtime) > 0)
             {
                 e.Cell.BackColor = System.Drawing.Color.Orange;
             }
         }
     }
     if (e.DataColumn.FieldName == "Date2")
     {
         DateTime dtime     = SafeValue.SafeDate(e.CellValue, new DateTime(1990, 1, 1));
         DateTime dtime_now = DateTime.Now;
         if (dtime_now.AddDays(5).CompareTo(dtime) > 0)
         {
             e.Cell.BackColor = System.Drawing.Color.Red;
         }
         else
         {
             if (dtime_now.AddDays(30).CompareTo(dtime) > 0)
             {
                 e.Cell.BackColor = System.Drawing.Color.Orange;
             }
         }
     }
 }
 private void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (IsColumnSupported((IModelColumn)e.DataColumn.Model(Model)))
     {
         e.Cell.Attributes["onclick"] = RenderHelper.EventCancelBubbleCommand;
     }
 }
示例#15
0
 protected void ProductsGridView_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "UnitsInInventory" && Convert.ToInt32(e.CellValue) < 0)
     {
         e.Cell.Font.Bold = true;
     }
 }
示例#16
0
 protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     try
     {
         switch (e.DataColumn.FieldName)
         {
         case "TO_SALE":
             if (Convert.ToInt32(e.CellValue) < 0)
             {
                 e.Cell.BackColor = System.Drawing.Color.Red;
                 e.Cell.ForeColor = System.Drawing.Color.White;
                 e.Cell.Font.Bold = true;
             }
             if (Convert.ToInt32(e.CellValue) == 0)
             {
                 e.Cell.BackColor = System.Drawing.Color.Yellow;
                 e.Cell.Font.Bold = true;
             }
             //case "LOTE VIGENTE":
             //    e.Cell.BackColor = System.Drawing.Color.LightGreen;
             //    e.Cell.Font.Bold = true;
             //    break;
             break;
         }
     }
     catch (Exception ex)
     {
         ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
     }
 }
示例#17
0
    protected void gridNDARview_OnHtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
    {
        var x = e;

        if (e.DataColumn.FieldName == "rownum")
        {
            string cellinfo = e.CellValue.ToString();
            int    pos      = cellinfo.IndexOf("|");

            if (pos > 0)
            {
                string rownum = cellinfo.Substring(0, pos);
                string url    = cellinfo.Substring(pos + 1, cellinfo.Length - (pos + 1));

                var container = e.Cell.NamingContainer;

                ASPxHyperLink link = new ASPxHyperLink();
                link.NavigateUrl = url;
                link.Text        = rownum;

                e.Cell.Controls.Clear();
                e.Cell.Controls.Add(link);
            }
        }
    }
示例#18
0
        /// <summary>
        /// The available rooms on html data cell prepared.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        /// <exception cref="ArgumentOutOfRangeException">
        /// Range exception
        /// </exception>
        private void AvailableRoomsOnHtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            AvailableStatus status;

            if ((e.DataColumn.FieldName != "RoomId") && Enum.TryParse(e.CellValue.ToString(), out status))
            {
                e.Cell.Text = string.Empty;
                switch (status)
                {
                case AvailableStatus.Available:
                    e.Cell.BackColor = Color.Green;
                    break;

                case AvailableStatus.NotAvailable:
                    e.Cell.BackColor = Color.Yellow;
                    break;

                case AvailableStatus.NotAvailableOccupied:
                    e.Cell.BackColor = Color.Red;
                    break;

                case AvailableStatus.NotAvailableBilled:
                    e.Cell.BackColor = Color.Blue;
                    break;

                case AvailableStatus.NotExistingDay:
                    e.Cell.BackColor = Color.Gray;
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }
        }
示例#19
0
        protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            try
            {
                switch (e.DataColumn.FieldName)
                {
                case "RESULT":
                    switch (e.CellValue.ToString())
                    {
                    case "DE MENOS":
                        e.Cell.BackColor = Color.Red;
                        e.Cell.ForeColor = Color.White;
                        e.Cell.Font.Bold = true;
                        break;

                    case "DE MAS":
                        e.Cell.BackColor = Color.Yellow;
                        e.Cell.Font.Bold = true;
                        break;

                    case "ESPECIFICADO":
                        e.Cell.BackColor = Color.LightGreen;
                        e.Cell.Font.Bold = true;
                        break;
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
示例#20
0
        protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            try
            {
                switch (e.DataColumn.FieldName)
                {
                case "EXPIRACION":

                    switch (e.CellValue.ToString())
                    {
                    case "LOTE EXPIRADO":
                        e.Cell.BackColor = System.Drawing.Color.Red;
                        e.Cell.ForeColor = System.Drawing.Color.White;
                        e.Cell.Font.Bold = true;
                        break;

                    case "LOTE PROXIMO A EXPIRAR":
                        e.Cell.BackColor = System.Drawing.Color.Yellow;
                        e.Cell.Font.Bold = true;
                        break;

                    case "LOTE VIGENTE":
                        e.Cell.BackColor = System.Drawing.Color.LightGreen;
                        e.Cell.Font.Bold = true;
                        break;
                    }

                    break;
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true);
            }
        }
        protected void gvCardiologists_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            Label lblStatus = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label;

            if (lblStatus != null && !string.IsNullOrEmpty(lblStatus.Text))
            {
                ASPxComboBox cmboBox = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "cmbRegStatus") as ASPxComboBox;

                //DropDownList dd = gvCardiologists.FindRowCellTemplateControl(e.VisibleIndex, null, "dd") as DropDownList;

                foreach (ListEditItem item in cmboBox.Items)
                {
                    if (item.Value.ToString() == lblStatus.Text)
                    {
                        item.Selected = true;

                        break;
                    }
                }



                //foreach (ListItem item in dd.Items)
                //{
                //    if (item.Value.ToString() == lblStatus.Text)
                //    {
                //        item.Selected = true;

                //        break;
                //    }
                //}
                //dd.DataBind();
            }
        }
示例#22
0
 void Grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.CellValue != null)
     {
         e.Cell.ToolTip = e.CellValue.ToString();
     }
 }
示例#23
0
        protected void gridViewSelectSparePart_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            ASPxCheckBox checkBox = gridViewSelectSparePart.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "chkBox") as ASPxCheckBox;

            if (checkBox != null)
            {
                if (e.DataColumn.FieldName == "is_selected")
                {
                    if (selectedSparePartList != null)
                    {
                        var row = (from t in selectedSparePartList
                                   where t.product_id == Convert.ToInt32(e.KeyValue) && t.product_type == "S" && !t.is_deleted
                                   select t).FirstOrDefault();
                        if (row != null)
                        {
                            checkBox.Checked = true;
                        }
                        else
                        {
                            checkBox.Checked = false;
                        }
                    }
                    //checkBox.Checked = (row["is_selected"]) == DBNull.Value ? false : true;
                }
            }
        }
示例#24
0
        protected void Grid_ExchangeRate_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            try
            {
                ASPxGridView grid = sender as ASPxGridView;
                NAS.DAL.Accounting.Currency.Currency currency_true_master = BO.get_Currency_true_master(session, CurrencyType_Id, true, Utility.Constant.ROWSTATUS_ACTIVE);
                ExchangeRate exchangerate_DenomiratorCurrencyId           = BO.get_ExchangeRate(session, e.KeyValue.ToString(), Utility.Constant.ROWSTATUS_ACTIVE);
                NAS.DAL.Accounting.Currency.Currency currencyId           = BO.get_CurrencyID(session, exchangerate_DenomiratorCurrencyId.DenomiratorCurrencyId.CurrencyId.ToString(), Utility.Constant.ROWSTATUS_ACTIVE);

                if (currencyId != null)
                {
                    //Setting Description for node
                    if (e.DataColumn.Name == "DenomiratorCurrencyId")
                    {
                        e.Cell.Text = String.Format("{0}", currencyId.Code);
                    }
                    if (e.DataColumn.Name == "Description_edit")
                    {
                        e.Cell.Text = String.Format("1 {0} = {1} {2}", currency_true_master.Code, exchangerate_DenomiratorCurrencyId.Rate, currencyId.Code);
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#25
0
 protected void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "luongcb")
     {
         ASPxLabel lbl_LuongCB = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lbl_LuongCB") as ASPxLabel;
         lbl_LuongCB.Text = InsertSymbol(e.CellValue.ToString());
     }
     if (e.DataColumn.FieldName == "thoidiem")
     {
         ASPxLabel lbl_thoidiem = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lbl_thoidiem") as ASPxLabel;
         lbl_thoidiem.Text = string.Format("{0:dd/MM/yyyy}", e.CellValue);
     }
     if (e.DataColumn.FieldName == "soqd")
     {
         ASPxHyperLink hyperDowload = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "hyperDowload") as ASPxHyperLink;
         ASPxImage     imgFile      = grid.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "imgFile") as ASPxImage;
         hyperDowload.Text = e.CellValue.ToString();
         if (e.GetValue("fileKem").ToString().Trim() != "")
         {
             imgFile.ImageUrl         = DotNetNuke.Common.Globals.ApplicationPath + "/images/imgadmin/file.png";
             hyperDowload.NavigateUrl = DotNetNuke.Common.Globals.ApplicationPath + "/images/FileQD/" + e.GetValue("fileKem").ToString();
         }
         else
         {
             imgFile.Visible = false;
         }
     }
 }
 protected void gridChucDanh_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "idChucDanh")
     {
         ASPxLabel lbl_STT = gridChucDanh.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lbl_STT") as ASPxLabel;
         lbl_STT.Text = nSTTCD++ + "";;
     }
 }
示例#27
0
 protected void grdFamily_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "relationshipid")
     {
         ASPxLabel lblRelate = grdFamily.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lblRelate") as ASPxLabel;
         lblRelate.Text = objRelation.GetRelationship(Int32.Parse(e.CellValue.ToString())).name;
     }
 }
示例#28
0
 protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "title")
     {
         ASPxTextBox textBox = ASPxGridView1.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "ASPxTextBox1") as ASPxTextBox;
         textBox.Text = Convert.ToString(e.CellValue);
     }
 }
 protected void GridView_BacLuongCaoNhat_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "id")
     {
         ASPxLabel lbl_STT = GridView_BacLuongCaoNhat.FindRowCellTemplateControl(e.VisibleIndex, e.DataColumn, "lbl_STT") as ASPxLabel;
         lbl_STT.Text = nSTT++ + "";;
     }
 }
 protected void GridPrChecklist_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         case "Checked": FormCheckBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
         case "DC_Mandatory": FormCheckBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
     }
 }
示例#31
0
        protected void EmployeeGrid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            Employee employee = objectSpace.GetObjectByKey <Employee>(e.KeyValue);

            if (!IsGranted(SecurityOperations.Read, employee, e.DataColumn))
            {
                e.Cell.Text = "Protected content";
            }
        }
示例#32
0
    void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
    {
        //add the attribute that will be used to find which column the cell belongs to
        e.Cell.Attributes.Add("ci", e.DataColumn.VisibleIndex.ToString());

        if (cellRowSpans.ContainsKey(e.Cell)) {
            e.Cell.RowSpan = cellRowSpans[e.Cell];
        }
    }
 protected void GridSysUserCredentials_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         case "EnableCreate": SetCheckBoxValue(e.VisibleIndex, "EnableCreate", e.CellValue); break;
         case "EnableUpdate": SetCheckBoxValue(e.VisibleIndex, "EnableUpdate", e.CellValue); break;
         case "EnableDelete": SetCheckBoxValue(e.VisibleIndex, "EnableDelete", e.CellValue); break;
         case "EnableView": SetCheckBoxValue(e.VisibleIndex, "EnableView", e.CellValue); break;
     }
 }
 protected void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.Caption != "ตำแหน่ง") return;
     String POS_NAME = e.GetValue("POS_NAME").ToString();
     if (POS_NAME == LastPosName)
     {
         //e.Cell
         //DevExpress.Web.ASPxGridView.Rendering.GridViewTableDataCell dataCell=
         //grid_SMM_JD_SUB_GROUP4.GetDataRow(e.)  e.Cell.Style["border-top"] = "none";
     }
 }
 protected void GridPrItemComponentListing_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         case "PRC_Desc": FormMemoBox(e.VisibleIndex, e.CellValue); break;
         case "PRC_Brand": FormTextBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
         case "PRC_Model": FormTextBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
         case "PRC_Qty": FormSpinEditor(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue,"Int32"); break;
         case "PRC_UnitCost": FormSpinEditor(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue, "Decimal"); break;
         case "PRC_ComponentNumber": FormDeleteLink(e.VisibleIndex, e.CellValue); break;
     }
 }
        protected void Grid_PBJ_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "PBJ_SmpCode")
            {
                ASPxHyperLink PBJ_SmpCode = (ASPxHyperLink)Grid_PBJ.FindRowCellTemplateControl(e.VisibleIndex, Grid_PBJ.DataColumns["PBJ_SmpCode"] as GridViewDataColumn, "PBJ_SmpCode");

                if (PBJ_SmpCode != null)
                {
                    PBJ_SmpCode.Text = e.CellValue.ToString();
                    PBJ_SmpCode.ClientInstanceName = "PBJ_SagaCode" + e.VisibleIndex.ToString();
                    PBJ_SmpCode.NavigateUrl = "javascript: PBJ_ViewRecord('" + e.CellValue + "');";
                }
            }
        }
        protected void GridLookupPegawaiAset_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "EmployeeName")
            {
                ASPxHyperLink EmployeeName = (ASPxHyperLink)GridLookupPegawaiAset.FindRowCellTemplateControl(e.VisibleIndex, GridLookupPegawaiAset.DataColumns["EmployeeName"] as GridViewDataColumn, "EmployeeName");

                if (EmployeeName != null)
                {
                    EmployeeName.ClientInstanceName = "EmployeeName_" + e.VisibleIndex.ToString();
                    EmployeeName.Text = e.CellValue.ToString();
                    EmployeeName.NavigateUrl = "javascript: PegawaiAsetSelected();";
                }
            }
        }
        protected void MainGrid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "UserDefinedId")
            {
                ASPxHyperLink UserDefinedId = (ASPxHyperLink)MainGrid.FindRowCellTemplateControl(e.VisibleIndex, MainGrid.DataColumns["UserDefinedId"] as GridViewDataColumn, "UserDefinedId");

                if (UserDefinedId != null)
                {
                    string UserGroupId = MainGrid.GetRowValues(e.VisibleIndex, "UserGroupId").ToString();
                    UserDefinedId.Text = e.CellValue.ToString();
                    UserDefinedId.ClientInstanceName = "UserDefinedId" + e.VisibleIndex.ToString();
                    UserDefinedId.NavigateUrl = "javascript: ViewSUG('" + UserGroupId + "');";
                }
            }
        }
        protected void GridSearch_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "PEMH_Name")
            {
                ASPxHyperLink link = (ASPxHyperLink)GridSearch.FindRowCellTemplateControl(e.VisibleIndex, GridSearch.DataColumns["PEMH_Name"] as GridViewDataColumn, "PEMH_Name");

                if (link != null)
                {
                    string PEMH_RowId = GridSearch.GetRowValues(e.VisibleIndex, "PEMH_RowId").ToString();
                    link.ClientInstanceName = "PEMH_Name" + e.VisibleIndex.ToString();
                    link.Text = e.CellValue.ToString();
                    link.NavigateUrl = "javascript: PemeriksaanSelected('" + PEMH_RowId + "');";
                }
            }
        }
        protected void MainGrid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "User_Salutation")
            {
                ASPxHyperLink User_Salutation = (ASPxHyperLink)MainGrid.FindRowCellTemplateControl(e.VisibleIndex, MainGrid.DataColumns["User_Salutation"] as GridViewDataColumn, "User_Salutation");

                if (User_Salutation != null)
                {
                    string PA_UserId = MainGrid.GetRowValues(e.VisibleIndex, "PA_UserId").ToString();
                    User_Salutation.Text = e.CellValue.ToString();
                    User_Salutation.ClientInstanceName = "User_Salutation" + e.VisibleIndex.ToString();
                    User_Salutation.NavigateUrl = "javascript: LoadPegawaiAset('" + PA_UserId + "');";
                }
            }
        }
        protected void MainGrid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "CatName")
            {
                ASPxHyperLink CatName = (ASPxHyperLink)MainGrid.FindRowCellTemplateControl(e.VisibleIndex, MainGrid.DataColumns["CatName"] as GridViewDataColumn, "CatName");

                if (CatName != null)
                {
                    string CatId = MainGrid.GetRowValues(e.VisibleIndex, "CatId").ToString();
                    CatName.ClientInstanceName = e.DataColumn.FieldName + e.VisibleIndex.ToString();
                    CatName.Text = e.CellValue.ToString();
                    CatName.NavigateUrl = "javascript: ViewCat('" + CatId + "');";
                }
            }
        }
        protected void GridSearch_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "AIDH_ExecutedBy")
            {
                ASPxHyperLink link = (ASPxHyperLink)GridSearch.FindRowCellTemplateControl(e.VisibleIndex, GridSearch.DataColumns["AIDH_ExecutedBy"] as GridViewDataColumn, "AIDH_ExecutedBy");

                if (link != null)
                {
                    link.ClientInstanceName = "AIDH_ExecutedBy" + e.VisibleIndex.ToString();
                    link.Text = e.CellValue.ToString();
                    string AIDH_ProcessId = GridSearch.GetRowValues(e.VisibleIndex, "AIDH_ProcessId").ToString();
                    link.NavigateUrl = "javascript: SusutNilaiSelected('" + AIDH_ProcessId + "');";
                }
            }
        }
        protected void GridAuditListing_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "ModifiedBy")
            {
                ASPxHyperLink ModifiedBy = (ASPxHyperLink)GridAuditListing.FindRowCellTemplateControl(e.VisibleIndex, GridAuditListing.DataColumns["ModifiedBy"] as GridViewDataColumn, "ModifiedBy");

                if (ModifiedBy != null)
                {
                    string ProcessId = GridAuditListing.GetRowValues(e.VisibleIndex, "ProcessId").ToString();
                    ModifiedBy.Text = e.CellValue.ToString();
                    ModifiedBy.ClientInstanceName = "ModifiedBy" + e.VisibleIndex.ToString();
                    ModifiedBy.NavigateUrl = "javascript: ViewAuditDetails('" + ProcessId + "');";
                }
            }
        }
示例#44
0
        protected void Grid_Floor_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "Floor_Code")
            {
                ASPxHyperLink Floor_Code = (ASPxHyperLink)Grid_Floor.FindRowCellTemplateControl(e.VisibleIndex, Grid_Floor.DataColumns["Floor_Code"] as GridViewDataColumn, "Floor_Code");

                if (Floor_Code != null)
                {
                    string FloorId = Grid_Floor.GetRowValues(e.VisibleIndex, "Floor_Id").ToString();
                    Floor_Code.Text = e.CellValue.ToString();
                    Floor_Code.ClientInstanceName = "Floor_Code" + e.VisibleIndex.ToString();
                    Floor_Code.NavigateUrl = "javascript: Floor_ViewRecord('" + FloorId + "');";
                }
            }
        }
 protected void GridSearch_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "LPH_LembagaName")
     {
         GridViewDataColumn gvc = GridSearch.DataColumns["LPH_LembagaName"] as GridViewDataColumn;
         var obj = GridSearch.FindRowCellTemplateControl(e.VisibleIndex, gvc, "hlId");
         ASPxHyperLink link = (ASPxHyperLink)obj;
         if (link != null)
         {
             string pmeriksaanId = GridSearch.GetRowValues(e.VisibleIndex, "Id").ToString();
             link.ClientInstanceName = "Pemeriksaan" + e.VisibleIndex.ToString();
             link.Text = e.CellValue.ToString();
             link.NavigateUrl = "javascript: PemeriksaanSelected('" + pmeriksaanId + "');";
         }
     }
 }
        protected void GridMainSearch_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "EmployeeName")
            {
                ASPxHyperLink EmployeeName = (ASPxHyperLink)GridMainSearch.FindRowCellTemplateControl(e.VisibleIndex, GridMainSearch.DataColumns["EmployeeName"] as GridViewDataColumn, "EmployeeName");

                if (EmployeeName != null)
                {
                    string ProcessID = GridMainSearch.GetRowValues(e.VisibleIndex, "LKH_ProcessId").ToString();
                    string Rev = GridMainSearch.GetRowValues(e.VisibleIndex, "LKH_RevNumber").ToString();
                    EmployeeName.ClientInstanceName = "EmployeeName" + e.VisibleIndex.ToString();
                    EmployeeName.Text = e.CellValue.ToString();
                    EmployeeName.NavigateUrl = "javascript: OnPageLoad_LaporanKehilanganSelected('" + ProcessID + "','" + Rev + "');";
                }
            }
        }
示例#47
0
 protected void GridLocationList_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         case "LocationShelf":
         case "LocationLevel":
         case "LocationSwath":
         case "LocationLine":
         case "LocationName":
         case "LocationSection":
             FormTextBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue);
             break;
         case "LocationNumber":
             FormDeleteLink(e.VisibleIndex, e.CellValue);
             break;
     }
 }
        protected void GridGrnLookup_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "GRNH_PrNumber")
            {
                ASPxHyperLink link = (ASPxHyperLink)GridGrnLookup.FindRowCellTemplateControl(e.VisibleIndex, GridGrnLookup.DataColumns["GRNH_PrNumber"] as GridViewDataColumn, "GRNH_PrNumber");

                if (link != null)
                {
                    string ProcessId = GridGrnLookup.GetRowValues(e.VisibleIndex, "GRNH_ProcessId").ToString();
                    string Revision = GridGrnLookup.GetRowValues(e.VisibleIndex, "GRNH_Revision").ToString();

                    link.ClientInstanceName = "GRNH_PrNumber" + e.VisibleIndex.ToString();
                    link.Text = e.CellValue.ToString();
                    link.NavigateUrl = "javascript: SelectGrn('" + ProcessId + "','" + Revision + "');";
                }
            }
        }
示例#49
0
        /// <summary>
        /// Creates link for redirect to untranslated resource.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UntranslatedTextGridView_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            switch (e.DataColumn.Name)
            {
                case "ResourceIdField":
                    string resourceSet = Convert.ToString(((ASPxGridView)sender).GetRowValues(e.VisibleIndex, "ResourceSet"));

                    e.Cell.Text = String.Concat(
                        "<a href='Default.aspx?ResourceSet=",
                        resourceSet,
                        "&CtlId=",
                        e.CellValue,
                        "'>",
                        e.CellValue,
                        "</a>");
                    break;
            }
        }
        protected void GridSearch_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "NoTender")
            {
                GridViewDataColumn gvc = GridSearch.DataColumns["NoTender"] as GridViewDataColumn;

                var obj = GridSearch.FindRowCellTemplateControl(e.VisibleIndex, gvc, "NoTender");

                ASPxHyperLink link = (ASPxHyperLink)obj;

                //ASPxHyperLink link = (ASPxHyperLink)GridSearch.FindRowCellTemplateControl(e.VisibleIndex, GridSearch.DataColumns["Nama Pemeriksaan"] as GridViewDataColumn, "Nama Pemeriksaan");

                if (link != null)
                {
                    string TawaranTenderId = GridSearch.GetRowValues(e.VisibleIndex, "TawaranTenderId").ToString();
                    link.ClientInstanceName = "NoTender" + e.VisibleIndex.ToString();
                    link.Text = e.CellValue.ToString();
                    link.NavigateUrl = "javascript: TawaranTenderSelected('" + TawaranTenderId + "');";
                }
            }
        }
    protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
    {
        int TonToiThieu = 0, QTyinstock = 0, TonMax = 0;
        if (e.DataColumn.FieldName == "TonToiThieu")
        {
            Session["min"] = e.GetValue("TonToiThieu").ToString();
        }
        if (e.DataColumn.FieldName == "TonMax")
        {
            Session["max"] = e.GetValue("TonMax").ToString();
        }
        if (e.DataColumn.FieldName == "QTyinstock")
        {
            try
            {
                Int32.TryParse(Session["min"].ToString(), out TonToiThieu);
                Int32.TryParse(Session["max"].ToString(), out TonMax);
            }
            catch (Exception)
            {
            }

            QTyinstock = Convert.ToInt32(e.CellValue);
            if (TonToiThieu > QTyinstock)
            {
                e.Cell.BackColor = System.Drawing.Color.Yellow;
                e.Cell.ForeColor = System.Drawing.Color.Red;
                e.Cell.Font.Bold = true;
            }
            if (QTyinstock > TonMax)
            {
                e.Cell.BackColor = System.Drawing.Color.LightCyan;
                e.Cell.ForeColor = System.Drawing.Color.Blue;
                e.Cell.Font.Bold = true;
            }
        }
    }
        protected void gdvSubMenuSistema_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.Caption == "Situação")
            {
                ASPxGridView gdv = (ASPxGridView)sender;

                if (bool.Parse(e.CellValue.ToString()))
                {
                    Image img = (Image)gdv.FindRowCellTemplateControl(e.VisibleIndex, (DevExpress.Web.ASPxGridView.GridViewDataColumn)gdv.Columns["Situacao"], "imgSubMenuStatus");

                    if (img != null)
                    {
                        //Usuário Ativo
                        img.AlternateText = "Menu ativo";
                        img.Attributes["title"] = "Menu ativo";
                        img.ImageUrl = "images/ativo.png";
                    }
                }
                else
                {
                    Image img = (Image)gdv.FindRowCellTemplateControl(e.VisibleIndex, (DevExpress.Web.ASPxGridView.GridViewDataColumn)gdv.Columns["Situacao"], "imgSubMenuStatus");

                    if (img != null)
                    {
                        //Usuário Desativado
                        img.AlternateText = "Menu desativado";
                        img.Attributes["title"] = "Menu desativado";
                        img.ImageUrl = "images/desativado.png";
                    }
                }
            }
        }
 protected void GridLembagaPemeriksa_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         case "LPD_EmpId": FormDeleteLink(e.DataColumn.FieldName, e.VisibleIndex, e.CellValue); break;
         case "LPD_MIR_Id": FormPerananCombo(e.DataColumn.FieldName, e.VisibleIndex, e.CellValue); break;
     }
 }
 private void grid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e){
     if (IsColumnSupported((IModelColumn) e.DataColumn.Model(Model))){
         e.Cell.Attributes["onclick"] = RenderHelper.EventCancelBubbleCommand;
     }
 }
 protected void NewAsset_ComponentGrid_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         case "PRIC_Desc": FormComponentGridTextBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
         case "PRIC_Brand": FormComponentGridTextBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
         case "PRIC_Model": FormComponentGridTextBox(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
         case "PRIC_Qty": FormComponentGridSpinEdit(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue, "I"); break;
         case "PRIC_UnitCost": FormComponentGridSpinEdit(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue, "D"); break;
         case "PRIC_ComponentNumber": FormComponentGridHyperLink(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
     }
 }
        protected void ASPxGridView1_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "RESULTADO") {

                decimal valor = 0;

                if (!Convert.IsDBNull(e.CellValue))
                {
                    valor = Convert.ToDecimal(e.CellValue);
                }

                if (valor < 0)
                {
                    //e.Column.CellStyle.ForeColor = System.Drawing.Color.Red;
                    e.Cell.Style["color"] = "#FF0000";
                }

            }
        }
示例#57
0
 protected void GRIDCONTRATOS_OnHtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "ADITIVOS") {
         if (e.CellValue.ToString() == "Sem Itens") {
             e.Cell.ForeColor = Color.Red;
         }
     }
 }
 protected void GridSearchAduanKerosakan_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     switch (e.DataColumn.FieldName)
     {
         case "CreatorName": CreateHyperLink(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
         case "AK_RefNumber": CreateHyperLink(e.VisibleIndex, e.DataColumn.FieldName, e.CellValue); break;
     }
 }
        protected void GridSelectedPegawaiPenyiasat_HtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "LKIB_InvestigatorEmpId")
            {
                ASPxHyperLink link = (ASPxHyperLink)GridSelectedPegawaiPenyiasat.FindRowCellTemplateControl(e.VisibleIndex, GridSelectedPegawaiPenyiasat.DataColumns["LKIB_InvestigatorEmpId"] as GridViewDataColumn, "LKIB_InvestigatorEmpId");

                if (link != null)
                {
                    string LKIB_InvestigatorEmpId = GridSelectedPegawaiPenyiasat.GetRowValues(e.VisibleIndex, "LKIB_InvestigatorEmpId").ToString();
                    link.ClientInstanceName = "LKIB_InvestigatorEmpId" + e.VisibleIndex.ToString();
                    link.NavigateUrl = "javascript: DeletePegawaiPenyiasat('" + LKIB_InvestigatorEmpId + "');";
                }
            }
            else if (e.DataColumn.FieldName == "LKIB_Role")
            {
                ASPxComboBox combo = (ASPxComboBox)GridSelectedPegawaiPenyiasat.FindRowCellTemplateControl(e.VisibleIndex, GridSelectedPegawaiPenyiasat.DataColumns["LKIB_Role"] as GridViewDataColumn, "LKIB_Role");

                if (combo != null)
                {
                    combo.ClientInstanceName = "LKIB_Role" + e.VisibleIndex.ToString();

                    if (e.CellValue.ToString() != "")
                        combo.Value = Convert.ToInt32(e.CellValue);
                    else
                        combo.SelectedIndex = -1;
                }
            }
        }
示例#60
0
 protected void gvCurrentLocItems_OnHtmlDataCellPrepared(object sender, ASPxGridViewTableDataCellEventArgs e)
 {
     if (e.DataColumn.FieldName == "ExpiryDate")
     {
         var cellvalue = e.CellValue;
         if (Convert.ToDateTime(e.CellValue) <= DateTime.Now.AddDays(7))
         {
             e.Cell.BackColor = Color.Orange;
             e.Cell.ForeColor = Color.White;
         }
         if ((DateTime)e.CellValue <= DateTime.Now)
         {
             e.Cell.BackColor = Color.Red;
             e.Cell.ForeColor = Color.White;
         }
     }
 }