protected void webspherecellgrid_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { //webspherecellgrid.EnableCallBacks = true; // e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';"); //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;"); if (e.RowType == GridViewRowType.EditForm) { try { if (e.GetValue("CellID") != " " && e.GetValue("CellID") != null) { Response.Redirect("~/Security/ImportWebsphereServers.aspx?CellID=" + e.GetValue("CellID") + "&CellName=" + e.GetValue("CellName") + "&HostName=" + e.GetValue("HostName") + "&ConnectionType=" + e.GetValue("ConnectionType") + "&PortNo=" + e.GetValue("PortNo") + "&GlobalSecurity=" + e.GetValue("GlobalSecurity") + "&Realm=" + e.GetValue("Realm"), false); //ASPxWebControl.RedirectOnCallback("ImportWebsphereServers.aspx?CellID=" + e.GetValue("CellID") + "&CellName=" + e.GetValue("CellName") + "&HostName=" + e.GetValue("HostName") + "&ConnectionType=" + e.GetValue("ConnectionType") + "&PortNo=" + e.GetValue("PortNo") + "&GlobalSecurity=" + e.GetValue("GlobalSecurity") + "&Realm=" + e.GetValue("Realm")); //Context.ApplicationInstance.CompleteRequest(); Context.ApplicationInstance.CompleteRequest(); } else { Response.Redirect("~/Security/ImportWebsphereServers.aspx", false); //Context.ApplicationInstance.CompleteRequest(); Context.ApplicationInstance.CompleteRequest(); } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } }
protected void WebsphereNodesgridview_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 DELSDefGridView_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;"); if (e.RowType == GridViewRowType.EditForm) { try { if (e.GetValue("ID") != " " && e.GetValue("ID") != null) { ASPxWebControl.RedirectOnCallback("DominoELS_Edit.aspx?EventKey=" + e.GetValue("ID")); Context.ApplicationInstance.CompleteRequest(); } else { ASPxWebControl.RedirectOnCallback("DominoELS_Edit.aspx"); Context.ApplicationInstance.CompleteRequest(); } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); } } }
protected void BusinessrGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { //if (e.RowType == GridViewRowType.EditForm) //{ // ASPxWebControl.RedirectOnCallback("DominoProperties.aspx?Key=" + e.GetValue("ID")); //} e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;"); //1/7/2014 NS added if (e.RowType == GridViewRowType.EditForm) { try { if (e.GetValue("ID") != "" && e.GetValue("ID") != null) { //Mukund: VSPLUS-844, Page redirect on callback Response.Redirect("MaintenanceBusinessHrs.aspx?Key=" + e.GetValue("ID"), false); Context.ApplicationInstance.CompleteRequest(); //Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } else { Response.Redirect("MaintenanceBusinessHrs.aspx", false); Context.ApplicationInstance.CompleteRequest(); } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } }
protected void DominoClusterGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.EditForm) { //Mukund: VSPLUS-844, Page redirect on callback try { if (e.GetValue("ID") != " " && e.GetValue("ID") != null) { ASPxWebControl.RedirectOnCallback("LotusDominoCluster.aspx?ID=" + e.GetValue("ID")); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } else { ASPxWebControl.RedirectOnCallback("LotusDominoCluster.aspx"); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } }
protected void BlackBerryGridView_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;"); if (e.RowType == GridViewRowType.EditForm) { //Mukund: VSPLUS-844, Page redirect on callback try { if (e.GetValue("SID").ToString() != "") { ASPxWebControl.RedirectOnCallback("BlackBerryEntertpriseServer.aspx?Key=" + e.GetValue("SID")); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } else { ASPxWebControl.RedirectOnCallback("BlackBerryEntertpriseServer.aspx"); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } }
protected void sharepointGridView_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;"); if (e.RowType == GridViewRowType.EditForm) { if (e.GetValue("ID").ToString() != " ") { //"DominoProperties.aspx?Key=" + e.GetValue("ID") //Mukund: VSPLUS-844, Page redirect on callback try { ASPxWebControl.RedirectOnCallback("SharepointServer.aspx?ID=" + e.GetValue("ID") + "&name=" + e.GetValue("ServerName") + "&Cat=" + e.GetValue("ServerType") + "&Loc=" + e.GetValue("Location") + "&ipaddr=" + e.GetValue("ipaddress")); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } } } }
protected void ELSDefGridView_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;"); if (e.RowType == GridViewRowType.EditForm) { string mode; try { if (e.GetValue("ID") != " " && e.GetValue("ID") != null) { mode = "update"; DevExpress.Web.ASPxWebControl.RedirectOnCallback("ELS_Edit.aspx?EventKey=" + e.GetValue("ID") + "&Mode=" + mode + "&Name=" + e.GetValue("Name") + ""); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } else { mode = "insert"; //Response.Redirect("ELS_Edit.aspx?Mode=" + mode, false); DevExpress.Web.ASPxWebControl.RedirectOnCallback("ELS_Edit.aspx?Mode=" + mode + ""); Context.ApplicationInstance.CompleteRequest();//Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); } } }
protected void dxgvSerial_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.GridViewRowType.Data) { Label lbl = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label; string strCoCode = e.GetValue("CO_CODE").ToString(); if (lbl != null && strCoCode != string.Empty) { using (DataModel.COMPANY_BO objT24_COMPANY_BO = new DataModel.COMPANY_BO()) { DataModel.COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode); if (objT24_COMPANY != null) { lbl.Text = objT24_COMPANY.COMPANY_NAME; } } } Label lbl2 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label; if (lbl2 != null) { if (e.GetValue("IsUsed") != null) { bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed")); if (strStatus) { lbl2.Text = "Đã cấp mã"; } else { lbl2.Text = "Đã xóa"; } } else { lbl2.Text = "Đã cấp mã"; } } Label lbl3 = dxgvSerial.FindRowCellTemplateControl(e.VisibleIndex, null, "lblMaDuThuong") as Label; if (lbl3 != null) { if (e.GetValue("Serials") != null) { string strSerials = e.GetValue("Serials").ToString(); if (!string.IsNullOrEmpty(strSerials)) { strSerials = Commons.Common.FormatSerial(strSerials.Split(new string[] { "|" }, StringSplitOptions.RemoveEmptyEntries).ToList()); } lbl3.Text = strSerials; } else { lbl3.Text = string.Empty; } } } }
protected void NodesGridView_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { //3/4/2016 NS modified for VSPLUS-2687 //e.Row.Attributes.Add("onmouseover", "this.originalcolor=this.style.backgroundColor;" + "this.style.backgroundColor='#C0C0C0';"); //e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=this.originalcolor;"); if (e.RowType == GridViewRowType.EditForm) { try { if (e.GetValue("ID") != " " && e.GetValue("ID") != null) { ASPxWebControl.RedirectOnCallback("~/Configurator/NodeSettingsProperties.aspx?ID=" + e.GetValue("ID")); Context.ApplicationInstance.CompleteRequest(); //Mukund, 05Aug14, VSPLUS-844:Page redirect on callback } else { ASPxWebControl.RedirectOnCallback("~/Configurator/NodeSettingsProperties.aspx"); Context.ApplicationInstance.CompleteRequest(); } } catch (Exception ex) { Log.Entry.Ins.WriteHistoryEntry(DateTime.Now.ToString() + " Exception - " + ex); //throw ex; } //} } }
protected void Grid2g_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) { return; } string month = e.GetValue("Month").ToString(); if (string.Equals(month, "TCK DISPONIBLES 2020")) { e.Row.BackColor = System.Drawing.Color.LightSteelBlue; } if (string.Equals(month, "TCK CONSUMIDO 2020")) { e.Row.BackColor = System.Drawing.Color.LightSalmon; } if (string.Equals(month, "CONSUMO")) { e.Row.BackColor = System.Drawing.Color.LightSalmon; } if (string.Equals(month, "PAQUETE CONTRATADO")) { e.Row.BackColor = System.Drawing.Color.DarkSeaGreen; } if (string.Equals(month, "PROM MES")) { e.Row.BackColor = System.Drawing.Color.DarkSeaGreen; } }
protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { e.Row.Attributes.Add("appTitle", e.GetValue("Title").ToString()); e.Row.Attributes.Add("appLabel", e.GetValue("Label").ToString()); e.Row.Attributes.Add("appStatus", e.GetValue("Status").ToString()); e.Row.Attributes.Add("appDuration", e.GetValue("DurationInHours").ToString()); } }
//CAMBIO EL COLOR DEL ENCABEZADO DE GRUPO DE LAS ASIGNACIONES ANULADAS protected void GridView_Pagos_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.GridViewRowType.Group) { string Estado = GridView_Pagos.GetRowValues(e.VisibleIndex, "Estado").ToString(); if (Estado == "Anulada") { e.Row.BackColor = System.Drawing.Color.FromArgb(252, 184, 185); e.Row.ForeColor = System.Drawing.Color.DarkRed; } } }
protected void ASPxGridView1_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.GridViewRowType.Data) { if (e.KeyValue != null && (bool)e.GetValue("IsSection")) { //if ((bool)e.GetValue("IsSection")) //{ e.Row.Visible = false; // } } } }
protected void gridChiTietNhapKho_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) { return; } int TRANGTHAI = Convert.ToInt32(e.GetValue("TRANGTHAI")); if (TRANGTHAI == 2) { e.Row.BackColor = System.Drawing.Color.AliceBlue; } }
protected void ASPxGridView1_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { int id = (int)e.KeyValue; ASPxGridView grid = (ASPxGridView)sender; GridViewDataColumn colAction = (GridViewDataColumn)grid.Columns["colAction"]; ASPxButton btnAction = (ASPxButton)grid.FindRowCellTemplateControl(e.VisibleIndex, colAction, "btnAction"); string state = GetSate(id); btnAction.ImageUrl = GetImagePath(state); btnAction.ClientSideEvents.Click = GetActionScript(id, state); } }
protected void grid_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { isPrevRowIsAlterRow = e.Row.CssClass.Contains("dxgvDataRowAlt"); } else if (e.RowType == GridViewRowType.Preview) { if (isPrevRowIsAlterRow) { e.Row.CssClass += " previewRowAlt"; } } }
protected void EmployeesGrid_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) { return; } int price = Convert.ToInt32(e.GetValue("Gun")); if (price >= 15) { e.Row.BackColor = System.Drawing.Color.LightPink; } else { e.Row.BackColor = System.Drawing.Color.LightGreen; } }
protected void grid_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { try { HyperLink hlDetail = grid.FindRowCellTemplateControl(e.VisibleIndex, grid.Columns["ListDetail"] as GridViewDataColumn, "hlDetail") as HyperLink; string ListDetail = grid.GetRowValues(e.VisibleIndex, "ListDetail").ToString(); if (ListDetail.StartsWith("javascript")) { hlDetail.NavigateUrl = "javascript:void(0)"; hlDetail.Attributes.Add("onclick", ListDetail); } else { hlDetail.NavigateUrl = ListDetail; } } catch { } }
protected void dxgvLiXi_HtmlRowCreated(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.GridViewRowType.Data) { Label lbl = dxgvLiXi.FindRowCellTemplateControl(e.VisibleIndex, null, "lblBranchName") as Label; string strCoCode = e.GetValue("CoCode").ToString(); if (lbl != null && strCoCode != string.Empty) { using (COMPANY_BO objT24_COMPANY_BO = new COMPANY_BO()) { COMPANY objT24_COMPANY = objT24_COMPANY_BO.GetByCOMPANY_CODE(strCoCode); if (objT24_COMPANY != null) { lbl.Text = objT24_COMPANY.COMPANY_NAME; } } } Label lbl2 = dxgvLiXi.FindRowCellTemplateControl(e.VisibleIndex, null, "lblStatus") as Label; if (lbl2 != null) { if (e.GetValue("IsUsed") != null) { bool strStatus = Convert.ToBoolean(e.GetValue("IsUsed")); if (strStatus) { lbl2.Text = "Đã cấp"; } else { lbl2.Text = "Đã xóa"; } } else { lbl2.Text = "Đã cấp"; } } } }
protected void OpsLiveGrid_HtmlRowPrepared(object sender, DevExpress.Web.ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) { return; } e.Row.BackColor = System.Drawing.Color.White;//set default to white first e.Row.ForeColor = System.Drawing.Color.Black; e.Row.Font.Bold = false; long personState = Convert.ToInt32(e.GetValue("PatrolPersonStateID")); long patrolRoleID = Convert.ToInt32(e.GetValue("PatrolRoleID")); var incident = e.GetValue("IncidentID"); var LastStateTimeStamp = e.GetValue("LastStateChangeTimeStamp"); if (personState == Core.Handler_AhwalMapping.PatrolPersonState_SunRise || personState == Core.Handler_AhwalMapping.PatrolPersonState_Sea || personState == Core.Handler_AhwalMapping.PatrolPersonState_Back || personState == Core.Handler_AhwalMapping.PatrolPersonState_BackFromWalking) { e.Row.BackColor = System.Drawing.Color.LightGreen; } if (personState == Core.Handler_AhwalMapping.PatrolPersonState_Land) { e.Row.BackColor = System.Drawing.Color.LightGray; } if (personState == Core.Handler_AhwalMapping.PatrolPersonState_Away) { e.Row.BackColor = System.Drawing.Color.Yellow; } if (personState == Core.Handler_AhwalMapping.PatrolPersonState_Sick || personState == Core.Handler_AhwalMapping.PatrolPersonState_Absent || personState == Core.Handler_AhwalMapping.PatrolPersonState_Off) { e.Row.BackColor = System.Drawing.Color.PaleVioletRed; } if (personState == Core.Handler_AhwalMapping.PatrolPersonState_WalkingPatrol) { e.Row.BackColor = System.Drawing.Color.CadetBlue; } //change associate color if (patrolRoleID == Core.Handler_AhwalMapping.PatrolRole_Associate) { e.Row.BackColor = System.Drawing.Color.SandyBrown; } //if he has incident, this color will override if (incident != null && !incident.Equals(DBNull.Value)) { // e.Row.BackColor = System.Drawing.Color.CadetBlue; //I love this color, I'll use it for walking patrol e.Row.BackColor = System.Drawing.Color.Red; e.Row.Font.Bold = true; e.Row.ForeColor = System.Drawing.Color.White; } //late logger if (LastStateTimeStamp != null && !LastStateTimeStamp.Equals(DBNull.Value)) { var lastTimeStamp = Convert.ToDateTime(LastStateTimeStamp); if (personState == Core.Handler_AhwalMapping.PatrolPersonState_Land) //max 1 hour { var hours = (DateTime.Now - lastTimeStamp).TotalHours; if (hours >= 1) { e.Row.ForeColor = System.Drawing.Color.PaleVioletRed; e.Row.Font.Bold = true; } } else if (personState == Core.Handler_AhwalMapping.PatrolPersonState_Away) //max 10 minues { var minutes = (DateTime.Now - lastTimeStamp).TotalMinutes; if (minutes >= 11) { e.Row.ForeColor = System.Drawing.Color.PaleVioletRed; e.Row.Font.Bold = true; } } } }