protected void gridInflironiePeriod_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (!object.Equals(e.RowType, GridViewRowType.Data)) return; if (e.GetValue("MonthBegin") != null && e.GetValue("YearBegin") != null && e.GetValue("MonthEnd") != null && e.GetValue("YearEnd") != null) { bool hasError = (int) e.GetValue("MonthBegin") < 1 || (int) e.GetValue("MonthBegin") > 12; hasError = hasError || (int) e.GetValue("MonthEnd") < 1 || (int) e.GetValue("MonthEnd") > 12; hasError = hasError || (int) e.GetValue("YearBegin") < 2014 || (int) e.GetValue("YearBegin") > 9999; hasError = hasError || (int)e.GetValue("YearEnd") < 2014 || (int)e.GetValue("YearEnd") > 9999; hasError = hasError || ((int)e.GetValue("YearBegin") * 12 + (int)e.GetValue("MonthBegin")) > ((int)e.GetValue("YearEnd") * 12 + (int)e.GetValue("MonthEnd")); if (hasError) { e.Row.ForeColor = System.Drawing.Color.Red; } } else if (e.GetValue("MonthBegin") != null && e.GetValue("YearBegin") != null) { bool hasError = (int)e.GetValue("MonthBegin") < 1 || (int)e.GetValue("MonthBegin") > 12; hasError = hasError || (int)e.GetValue("YearBegin") < 2014 || (int)e.GetValue("YearBegin") > 9999; if (hasError) { e.Row.ForeColor = System.Drawing.Color.Red; } } }
protected void AssingLabe_OnHtmlRowCreated( object sender, ASPxGridViewTableRowEventArgs e ) { if (e.RowType != GridViewRowType.Data) return; { Label olabe = gv.FindRowCellTemplateControl(e.VisibleIndex, null, "lblSign") as Label; if (olabe != null) { if (e.VisibleIndex + 1 == 2 || e.VisibleIndex + 1 == 5 ) { olabe.Text = "Expired in 90 days"; olabe.ToolTip = olabe.Text; olabe.BackColor = System.Drawing.Color.Yellow; olabe.Width = Unit.Pixel(120); } else if (e.VisibleIndex + 1 == 7 || e.VisibleIndex + 1 == 9) { olabe.ToolTip = "Not qualified"; olabe.BackColor = System.Drawing.Color.Red; } else { olabe.ToolTip = "Qualified"; } } } }
protected void gridViewMalware_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return; ASPxHyperLink linkMlwr = gridViewMalware.FindRowCellTemplateControl(e.VisibleIndex, null, "mlwrID") as ASPxHyperLink; if (linkMlwr == null) return; int mlwId = (int)e.KeyValue; linkMlwr.NavigateUrl += "?mlwrID=" + mlwId; }
//private void SelectChild(int parent, int child) //{ // var childRowCount = PurchaseOrdersGrid.GetChildRowCount(parent); // PurchaseOrdersGrid. //} protected void Grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Group) { return; } var checkBox = (ASPxCheckBox)PurchaseOrdersGrid.FindGroupRowTemplateControl(e.VisibleIndex, "groupCheckBox"); checkBox.Checked = GetChecked(e.VisibleIndex); }
//protected void UsersGrid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) //{ // e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#F2F9FF';"); // e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white';"); //} protected void grid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { int index = grid.FocusedRowIndex; if (e.VisibleIndex != index) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#F2F9FF';"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white';"); } }
void grid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (Grid.GetRowLevel(e.VisibleIndex) != Grid.GroupCount) return; for (int i = e.Row.Cells.Count - 1; i >= 0; i--) { DevExpress.Web.ASPxGridView.Rendering.GridViewTableDataCell dataCell = e.Row.Cells[i] as DevExpress.Web.ASPxGridView.Rendering.GridViewTableDataCell; if (dataCell != null) { MergeCells(dataCell.DataColumn, e.VisibleIndex, dataCell); } } }
/// <summary> /// Davinder Kumar 03-06-2011 /// Method Use To get the Data of The Rows /// </summary> protected void GridViewCustomTPNeed_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data || e.Row.Cells.Count < 3) { return; } if (e.GetValue("NeedId").ToString() != "") { NeedId = Convert.ToInt32(e.GetValue("NeedId")); } if (e.GetValue("NeedText").ToString() != "") { NeedText = HttpUtility.UrlEncode(Convert.ToString(e.GetValue("NeedText"))); } else { NeedText = string.Empty; } string Checked = string.Empty; using (DataSet dataSetTreatmentPlan = BaseCommonFunctions.GetScreenInfoDataSet()) { //if (e.DataColumn.FieldName == "NeedId") //{ string lstSessionNeedId = string.Empty; DataRow[] drSessionNeeds = dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"].Select("NeedId='" + NeedId + "' and ISNULL(RecordDeleted,'N')<>'Y'"); foreach (DataRow drNeeds in drSessionNeeds) { lstSessionNeedId += drNeeds["TPGoalId"].ToString() + ","; } DataRow[] dRowGoalNeed = dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"].Select("TPGoalId='" + TPGoalId + "' AND NeedId='" + NeedId + "' and ISNULL(RecordDeleted,'N')<>'Y'"); if (dRowGoalNeed.Length > 0) { Checked = "Checked"; //e.Row.Cells[0].Text = "<table><tr><td style='width:20px;'><img id=Img_CustomTPGoalNeeds_" + NeedId + " name=Img_CustomTPGoalNeeds_" + NeedId + " src=" + RelativePath + "App_Themes/Includes/Images/deleteIcon.gif tag=" + dRowGoalNeed[0]["TPGoalNeeds"].ToString() + " style='cursor:hand;display:None;' onclick = \"DeleteTpGoalNeeds('" + NeedId + "','" + e.GetValue("LinkedInDb") + "','" + e.GetValue("LinkedInSession") + "');\"/></td><td><input type='checkbox' checked='checked' id='CheckBox_" + NeedId + "_" + NeedText + "' name='CheckBox_" + NeedId + "_" + NeedText + "' style='width:20px;' onclick=ChangeDisplayChecked('Img_CustomTPGoalNeeds_" + NeedId + "','CheckBox_" + NeedId + "') /> <label for='CheckBox_" + NeedId + "_" + NeedText + "' >" + SHS.BaseLayer.BaseCommonFunctions.TrancateElementText(NeedText, 20) + "</label> <input type='hidden' id='Hidden_" + NeedId + "' value='" + NeedText + "' /> <input type='hidden' id='HiddenSessionNeeds_" + NeedId + "' value='"+lstSessionNeedId+"' /> </td></tr></table>"; e.Row.Cells[0].Text = "<table width='43'><tr><td style='width:18px;'><img id='Img_CustomTPGoalNeeds_" + NeedId + "' name='Img_CustomTPGoalNeeds_" + NeedId + "' src='" + RelativePath + "App_Themes/Includes/Images/deleteIcon.gif' tag='" + dRowGoalNeed[0]["TPGoalNeeds"].ToString() + "' style='cursor:hand;display:None;' onclick = \"DeleteTpGoalNeeds('" + NeedId + "','" + e.GetValue("LinkedInDb") + "','" + e.GetValue("LinkedInSession") + "');\"/></td><td style='width:18px'><input type='checkbox' checked='checked' id='CheckBox_" + NeedId + "' name='CheckBox_" + NeedId + "' onclick=ChangeDisplayChecked('Img_CustomTPGoalNeeds_" + NeedId + "','CheckBox_" + NeedId + "') /> <input type='hidden' id='Hidden_" + NeedId + "' value='" + NeedText + "' /> <input type='hidden' id='HiddenSessionNeeds_" + NeedId + "' value='" + lstSessionNeedId + "' /> </td></tr></table>"; e.Row.Cells[2].Text = (dRowGoalNeed[0]["DateNeedAddedtoPlan"].ToString().Trim() != string.Empty) ? Convert.ToDateTime(dRowGoalNeed[0]["DateNeedAddedtoPlan"]).ToString("MM/dd/yyyy") : ""; } else { Checked = string.Empty; e.Row.Cells[0].Text = "<table width='43'><tr><td style='width:18px;'><img id='Img_CustomTPGoalNeeds_" + NeedId + "' name='Img_CustomTPGoalNeeds_" + NeedId + "' src='" + RelativePath + "App_Themes/Includes/Images/deleteIcon.gif' tag='" + -1 + "' style='cursor:hand;display:block;' onclick = \"DeleteTpGoalNeeds('" + NeedId + "','" + e.GetValue("LinkedInDb") + "','" + e.GetValue("LinkedInSession") + "');\"/></td><td style='width:18px'><input type='checkbox' id='CheckBox_" + NeedId + "' name='CheckBox_" + NeedId + "' onclick=ChangeDisplayChecked('Img_CustomTPGoalNeeds_" + NeedId + "','CheckBox_" + NeedId + "') /><input type='hidden' id='Hidden_" + NeedId + "' value='" + NeedText + "' /> <input type='hidden' id='HiddenSessionNeeds_" + NeedId + "' value='" + lstSessionNeedId + "' /> </td></tr></table>"; } e.Row.Cells[1].Text = "<label for='CheckBox_" + NeedId + "_" + NeedText + "' id='label_" + NeedId + "'>" + SHS.BaseLayer.BaseCommonFunctions.TrancateElementText(HttpUtility.UrlDecode(NeedText), 20) + "</label>"; //GrantPermissionTemplateItems //e.DataColumn.CellStyle.HorizontalAlign = HorizontalAlign.Center; //DataRow[] dRowGoalNeed = dataSetTreatmentPlan.Tables["CustomTPGoalNeeds"].Select("TPGoalId='" + TPGoalId + "' AND NeedId='" + NeedId + "' and ISNULL(RecordDeleted,'N')<>'Y'"); } }
protected void UsersGrid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { int index = UsersGrid.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;"); } }
protected void gvProducts_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { object rowOrder = e.GetValue("DisplayOrder"); if (rowOrder != null) { e.Row.Attributes.Add("sortOrder", rowOrder.ToString()); } } }
protected void grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { e.Row.CssClass += String.Format(" dataRow{0}", e.VisibleIndex); ASPxGridView g = sender as ASPxGridView; ASPxCheckBox cb = g.FindRowCellTemplateControl(e.VisibleIndex, (GridViewDataColumn)g.Columns["Active"], "chk") as ASPxCheckBox; if (cb.Checked) { e.Row.CssClass += " rowChecked"; } }
/// <summary> /// 设置DXGridView行实现鼠标悬停变色 /// </summary> static void DXGridView_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { //当鼠标停留时更改背景色 e.Row.Attributes.Add("onmouseover", "row_bgcolor=this.style.backgroundColor;this.style.backgroundColor='#f5f5f5';"); //当鼠标移开时还原背景色 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=row_bgcolor;"); } }
protected void gridActDocument_OnHtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { var color = (int?)e.GetValue("DocColor"); if (color.HasValue) { e.Row.BackColor = Color.FromArgb(color.Value); } } }
protected void grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { int cmdColIndex = e.Row.Cells.Count - 1; if (e.GetValue("LOG_NAME").ToString() == "Admin" && e.Row.Cells[cmdColIndex].Controls.Count == 2) { e.Row.Cells[cmdColIndex].Controls[1].Visible = false; } } }
protected void ASPxGridView1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data && e.VisibleIndex % 2 == 0) { e.Row.BackColor = System.Drawing.Color.Azure; } if (e.RowType == GridViewRowType.Detail && e.VisibleIndex % 2 == 0) { e.Row.BackColor = System.Drawing.Color.Azure; } }
protected void gridDanhSachHangHoa_Temp_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { Color color = (Color)ColorTranslator.FromHtml("#FF9797"); int TonKho = Convert.ToInt32(e.GetValue("TonKho")); int SoLuong = Convert.ToInt32(e.GetValue("SoLuong")); if (TonKho < SoLuong) { e.Row.BackColor = color; } }
protected void gridDistributors_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { ASPxHyperLink link = (ASPxHyperLink) gridDistributors.FindRowCellTemplateControl(e.VisibleIndex, gridDistributors.Columns["colRemove"] as GridViewDataColumn, "hlRemoveDistributor"); if (link != null) { link.ClientSideEvents.Click = string.Format("function(s,e){{OnRemoveDistributorClick(this,{0})}}", e.KeyValue); } }
protected void ASPxGridView1_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.EditForm) { ASPxTextBox txt = ((ASPxGridView)sender).FindEditFormTemplateControl("ASPxTextBox1") as ASPxTextBox; ASPxLabel errLab = ((ASPxGridView)sender).FindEditFormTemplateControl("errLab") as ASPxLabel; if (!txt.IsValid) { errLab.Text = "Please correct this value"; } } }
protected void Grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Group) { ASPxCheckBox checkBox = Grid.FindGroupRowTemplateControl(e.VisibleIndex, "checkBox") as ASPxCheckBox; if (checkBox != null) { checkBox.ClientSideEvents.CheckedChanged = string.Format("function(s, e){{ Grid.PerformCallback('{0};' + s.GetChecked()); }}", e.VisibleIndex); checkBox.Checked = GetChecked(e.VisibleIndex); } } }
protected void gridSteps_OnHtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { var color = (int?)e.GetValue("AlertColor"); var days = (int?)e.GetValue("AlertDays"); if (color.HasValue && days.HasValue && days.Value > 0) { e.Row.BackColor = Color.FromArgb(color.Value); } } }
void Grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { // Subscribe group checkboxes on CheckedChanged event if (e.RowType == GridViewRowType.Group) { ASPxCheckBox checkBox = Grid.FindGroupRowTemplateControl(e.VisibleIndex, "checkBox") as ASPxCheckBox; if (checkBox != null) { checkBox.Checked = GetChecked(e.VisibleIndex); } } }
protected void ASPxGridView2_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { string val = e.GetValue("ProductID").ToString(); GridViewDataColumn col = ((ASPxGridView)sender).Columns["Template"] as GridViewDataColumn; ASPxButton bt = ((ASPxGridView)sender).FindRowCellTemplateControl(e.VisibleIndex, col, "ASPxButton2") as ASPxButton; bt.ClientInstanceName = "button" + e.VisibleIndex.ToString(); Session["ProductID"] = val; bt.ClientSideEvents.Click = "function(s,e){panel.PerformCallback(" + val + "+';'+s.name); }"; } }
protected void grvChamCong_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { //int _id = Utils.CIntDef(e.KeyValue); //var _obj = db.USERs.Where(n => n.USER_ID == _id).ToList(); //if (_obj.Count > 0) //{ // if (_obj[0].USER_ACTIVE == 0) // { // e.Row.ForeColor = Color.FromName("#FF0000"); // } //} }
public static void gdvEffective_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { ASPxGridView gdv = (ASPxGridView)sender; object[] effectivePeriod = (object[])gdv.GetRowValues(e.VisibleIndex, "EffectiveFrom", "EffectiveTo"); if (!((DateTime)effectivePeriod[0] <= DateTime.Now && (DateTime)effectivePeriod[1] >= DateTime.Now)) { e.Row.ForeColor = System.Drawing.Color.Red; } } }
protected void grid_HtmlRowPrepared(object sender, 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 { } try { HyperLink hlDetail2 = grid.FindRowCellTemplateControl(e.VisibleIndex, grid.Columns["ListDetail2"] as GridViewDataColumn, "hlDetail") as HyperLink; string ListDetail2 = grid.GetRowValues(e.VisibleIndex, "ListDetail2").ToString(); if (ListDetail2.StartsWith("javascript")) { hlDetail2.NavigateUrl = "javascript:void(0)"; hlDetail2.Attributes.Add("onclick", ListDetail2); } else { hlDetail2.NavigateUrl = ListDetail2; } } catch { } try { Table tblReason = grid.FindRowCellTemplateControl(e.VisibleIndex, grid.Columns["ListReasonQry"] as GridViewDataColumn, "tblReason") as Table; string ListReasonQry = grid.GetRowValues(e.VisibleIndex, "ListReasonQry").ToString(); if (ListReasonQry != null && ListReasonQry.Trim() != "") { DataTable dtReason = conn.GetDataTable(ListReasonQry, null, dbtimeout); for (int i = 0; i < dtReason.Rows.Count; i++) { TableRow r = new TableRow(); TableCell c = new TableCell(); c.Wrap = false; c.Text = dtReason.Rows[i][0].ToString(); r.Cells.Add(c); tblReason.Rows.Add(r); } } } catch { } }
protected void ASPxGridView1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.VisibleIndex < 0) { return; } string item_class_code = e.GetValue("ITEM_CLASS").ToString(); string replace_flag = e.GetValue("REPLACE_FLAG").ToString(); string vendercode = e.GetValue("GYSMC").ToString(); switch (item_class_code)//重要件显示绿色 { case "1": e.Row.BackColor = Color.LimeGreen; break; case "2": e.Row.BackColor = Color.LimeGreen; break; case "3": e.Row.BackColor = Color.LimeGreen; break; case "4": e.Row.BackColor = Color.LimeGreen; break; case "5": e.Row.BackColor = Color.LimeGreen; break; default: break; } if (replace_flag == "A") { e.Row.BackColor = Color.Yellow;//替换零件显示黄色 } if (replace_flag == "B" || replace_flag == "Y") { e.Row.BackColor = Color.Orange;//临时措施替换零件显示橘黄色 } if (vendercode != "") { e.Row.BackColor = Color.Red;//指定供应商零件显红色 } //if (item_type == "A" || item_type == "B") //{ // e.Row.Cells[0].BackColor = System.Drawing.Color.Magenta ; //} }
protected void ASPxGridView1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.VisibleIndex < 0) { return; } string status = e.GetValue("REMARK").ToString(); //已确认绿色 if (status.Contains("预留号")) { e.Row.BackColor = System.Drawing.Color.LightPink; } status = e.GetValue("SN_FLAG").ToString(); //已生成流水号黄色 switch (status) { case "Y": e.Row.BackColor = System.Drawing.Color.Yellow; break; } status = e.GetValue("CONFIRM_FLAG").ToString(); //已确认绿色 switch (status) { case "Y": e.Row.BackColor = System.Drawing.Color.Green; break; } status = e.GetValue("BOM_FLAG").ToString();//已生成BOM蓝色 switch (status) { case "Y": e.Row.BackColor = System.Drawing.Color.LightSkyBlue; break; } status = e.GetValue("ITEM_FLAG").ToString(); //已库房确认红色 switch (status) { case "Y": e.Row.BackColor = System.Drawing.Color.Red; break; } status = e.GetValue("RUN_FLAG").ToString(); //已库房确认红色 switch (status) { case "C": e.Row.BackColor = System.Drawing.Color.Gray; //已取消的灰色 break; case "P": e.Row.BackColor = System.Drawing.Color.GreenYellow; //已暂停的黄绿色 break; } }
protected void ASPxGridView1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { // Checks whether the generated row has the errors. bool hasError = e.GetValue("FirstName") == null; hasError = hasError || e.GetValue("LastName") == null; // If the row has the error(s), its text color is set to red. if (hasError) { e.Row.ForeColor = System.Drawing.Color.Red; } }
protected void ASPxGridView1_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { ASPxGridView grid = sender as ASPxGridView; ASPxRadioButton discontinued = grid.FindRowCellTemplateControl(e.VisibleIndex, grid.Columns["Discontinued"] as GridViewDataColumn, "btnDiscontinued") as ASPxRadioButton; ASPxRadioButton inproduction = grid.FindRowCellTemplateControl(e.VisibleIndex, grid.Columns["InProduction"] as GridViewDataColumn, "btnInProduction") as ASPxRadioButton; discontinued.ClientInstanceName = "btnDiscontinued" + e.VisibleIndex; inproduction.ClientInstanceName = "btnInProduction" + e.VisibleIndex; inproduction.ClientSideEvents.CheckedChanged = String.Format("function (s,e) {{if(btnInProduction{0}.GetChecked()) {{btnDiscontinued{0}.SetChecked(false);}}}}", e.VisibleIndex); discontinued.ClientSideEvents.CheckedChanged = String.Format("function (s,e) {{if(btnDiscontinued{0}.GetChecked()) {{btnInProduction{0}.SetChecked(false);}}}}", e.VisibleIndex); } }
protected void gdvinv1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) { return; } var U_BF_CodKit = Convert.ToString(e.GetValue("U_BF_CodKit")); if (!string.IsNullOrWhiteSpace(U_BF_CodKit)) { e.Row.BackColor = Color.Lavender; } }
protected void grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { ASPxGridView g = sender as ASPxGridView; int groupIndex = g.GetRowLevel(e.VisibleIndex); if ((e.RowType == GridViewRowType.Group) && (groupIndex > 0)) { if (e.Row.Cells.Count > groupIndex && e.Row.Cells[groupIndex] != null && e.Row.Cells[groupIndex].Controls.Count > 0) { e.Row.Cells[groupIndex].Controls[0].Visible = false; } } }
protected void ASPxGridView1_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.VisibleIndex < 0) { return; } string SJBS = e.GetValue("SJBS").ToString(); //根据执行情况0,1背景色不同 if (SJBS == "1") { e.Row.BackColor = System.Drawing.Color.LightGreen; } }
protected void ASPxGridView1_user_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { int _id = Utils.CIntDef(e.KeyValue); var _obj = db.USERs.Where(n => n.USER_ID == _id).ToList(); if (_obj.Count > 0) { if (_obj[0].USER_ACTIVE == 0) { e.Row.ForeColor = Color.FromName("#FF0000"); } } }
protected void gridChannels_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { ASPxHyperLink link = (ASPxHyperLink) gridChannels.FindRowCellTemplateControl(e.VisibleIndex, gridChannels.Columns["colHistoryLink"] as GridViewDataColumn, "hlChannelHistory"); if (link != null) { link.Text = Utilities.GetResourceString("Common", "History"); link.ClientSideEvents.Click = string.Format("function(s,e){{OnChannelHistoryClick(this, {0})}}", e.KeyValue); } }
protected void gridDoanhThu_HtmlRowPrepared(object sender, 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 gdvPartyAttribute_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { ASPxGridView gdv = (ASPxGridView)sender; object[] EffectivePeriod = (object[])gdv.GetRowValues(e.VisibleIndex, "EffectiveFrom", "EffectiveTo"); if (e.RowType == GridViewRowType.Data) { if (!(((DateTime)EffectivePeriod[0]) <= DateTime.Now && ((DateTime)EffectivePeriod[1]) >= DateTime.Now)) { e.Row.ForeColor = System.Drawing.Color.Red; } } }
protected void gridMulitiReplace_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.VisibleIndex < 0) { return; } string status = e.GetValue("STATUS").ToString(); //失效黄色 if (status == "无效") { e.Row.BackColor = System.Drawing.Color.Yellow; } }
protected void grid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) return; String POS_NAME = e.GetValue("POS_NAME").ToString(); if (POS_NAME != LastPosName) { LastPosName = POS_NAME; } else { e.Row.Cells[1].Style["border-top"] = "2px outset white"; } }
protected void gridList_OnHtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { var visibleIndex = e.VisibleIndex; var chShow = gridList.FindRowCellTemplateControl(visibleIndex, null, "chShow") as ASPxCheckBox; if (chShow != null) { chShow.Checked = (bool) e.GetValue("Show"); chShow.ClientSideEvents.ValueChanged = jsFunctionOverlay(string.Format("ShowPaymentData_Change(s.GetValue(), '{0}');", e.KeyValue)); } } }
protected void gridFondSpi_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { try { if (e.RowType != GridViewRowType.Data) return; var isFilled = (int?)gridFondSpi.GetRowValues(e.VisibleIndex, "IsFilled"); if (isFilled == null) return; if (isFilled == 0) for (int i = 0; i < e.Row.Cells.Count; i++) e.Row.Cells[i].Style.Add("color", "red"); } catch { } }
protected void grdUtenti_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == DevExpress.Web.ASPxGridView.GridViewRowType.EditForm) { ASPxGridView grdSender = (sender as ASPxGridView); System.Data.DataRow r = DALRuntime.tblUtenti.Rows.Find(e.KeyValue); // Data bind del combo del profilo ASPxComboBox cbxProfilo = (ASPxComboBox)grdSender.FindEditFormTemplateControl("cbxProfilo"); if (cbxProfilo != null) { cbxProfilo.DataSource = DALRuntime.getProfili(); cbxProfilo.DataBindItems(); if (r != null) cbxProfilo.Value = r["cz_profilo"]; } } }
protected void gv_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { }
protected void grid_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { try { if (e.RowType != GridViewRowType.Data) return; bool isdtroy = false; if (e.GetValue("isdeleted").ToString() != null) { Boolean.TryParse(e.GetValue("isdeleted").ToString(), out isdtroy); if (isdtroy) { bool isPermissionRestore = false; try { bool.TryParse(PermissionInfo.Rows[0]["isrestore"].ToString(), out isPermissionRestore); } catch { } if (isPermissionRestore) { e.Row.Enabled = !isdtroy; e.Row.ForeColor = System.Drawing.Color.LightGray; } else { e.Row.Visible = false; } } } } catch { } }
protected void gridAptosPagamento_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) return; string value = e.GetValue("TEMCONTASBANCO").ToString(); if (value != string.Empty && value != null) e.Row.BackColor = System.Drawing.Color.DarkSeaGreen; }
protected void GridGroupDetail_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.Row.Attributes["GROUP_NAME"] == group_Name) return; else { group_Name = e.Row.Attributes["GROUP_NAME"]; } }
protected void GridGroupDetail_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.KeyValue != null) { if (e.GetValue("AUTH").ToString() == "System") { e.Row.BackColor = Color.FromName("#E6E6FA"); e.Row.ForeColor = Color.Black; } else { } } }
}//end menu names loop #endregion #region gridview crud events /// <summary> /// on row created get lookup values /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void dxgrdCourier_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { ASPxGridView _grd = (ASPxGridView)sender; try { if (e.RowType == GridViewRowType.Data) { //company int _id = wwi_func.vint(e.GetValue("DocsDespatchID").ToString()); string _txt = wwi_func.lookup_multi_values("CompanyName,Address1,Address2,Address3,CountryName,TelNo", "view_delivery_address", "CompanyID", _id); if (_txt != "") { string[] _lx = _txt.Split(Environment.NewLine.ToCharArray()); //company ASPxLabel _lbl = (ASPxLabel)_grd.FindRowTemplateControl(e.VisibleIndex, "dxlblDocsDespatchIDView"); if (_lbl != null) { _lbl.Text = _lx[0]; } //address _lbl = (ASPxLabel)_grd.FindRowTemplateControl(e.VisibleIndex, "dxlblDocsDespatchIDView2"); if (_lbl != null) { _lbl.Text = _txt.Replace(_lx[0], "").Trim(); ; } } //contact _id = wwi_func.vint(e.GetValue("ContactID").ToString()); _txt = wwi_func.lookup_multi_values("ContactName,Email", "ContactTable", "ContactID", _id, "|"); if (_txt != "") { string[] _lx = _txt.Split("|".ToCharArray()); //name ASPxLabel _lbl = (ASPxLabel)_grd.FindRowTemplateControl(e.VisibleIndex, "dxlblContactIDView"); if (_lbl != null) { _lbl.Text = _lx[0].Trim(); } //email _lbl = (ASPxLabel)_grd.FindRowTemplateControl(e.VisibleIndex, "dxlblContactIDView2"); if (_lbl != null) { _lbl.Text = _lx.Length > 0 ? _lx[1] : ""; } } //get the status value int _original = wwi_func.vint(e.GetValue("Original").ToString()); string _target = _original <= 2 ? "Despatch Date" : "Date Emailed"; //format date if original = 2 pass to docs despatched date, if 3 pass to emailed date string _dt = e.GetValue("DocumentationDespatched") != null ? wwi_func.vdatetime(e.GetValue("DocumentationDespatched").ToString()).ToShortDateString() : ""; //set caption ASPxLabel _lb = (ASPxLabel)_grd.FindRowTemplateControl(e.VisibleIndex, "dxlblDespatchDateCaption"); if (_lb != null) { _lb.Text = _target; } _lb = (ASPxLabel)_grd.FindRowTemplateControl(e.VisibleIndex, "dxlblDespatchDateView"); if (_lb != null) { _lb.Text = _dt; } } else if( e.RowType == GridViewRowType.EditForm) { //edit form stuff //populate company address label int _id = wwi_func.vint(e.GetValue("DocsDespatchID").ToString()); string _txt = wwi_func.lookup_multi_values("Address1,Address2,Address3,CountryName,TelNo", "view_delivery_address", "CompanyID", _id); if (_txt != "") { //string[] _lx = _txt.Split(Environment.NewLine.ToCharArray()); //address ASPxLabel _lb = (ASPxLabel)_grd.FindEditFormTemplateControl("dxlblAddress2"); if (_lb != null) { _lb.Text = _txt; } } //bind contact or we lose the contact name on edit ASPxComboBox _editor = (ASPxComboBox)_grd.FindEditFormTemplateControl("dxcboClientContact"); if (_editor != null) { string[] _cols = { "ContactID, ContactName", "Email" }; string[] _order = { "ContactName" }; SqlQuery _qry = new Select(_cols).From(DAL.Logistics.Tables.ContactTable).OrderAsc(_order); if (_id > 0) { _qry.Where("CompanyID").IsEqualTo(_id); } IDataReader _rd1 = _qry.ExecuteReader(); _editor.DataSource = _rd1; _editor.ValueField = "ContactID"; _editor.TextField = "ContactName"; _editor.DataBind(); _editor.SelectedItem = _editor.Items.FindByValue(e.GetValue("ContactID")); } }//end if } catch (Exception ex) { string _ex = ex.Message.ToString(); this.dxlblErr.Text += _ex; this.dxpnlErr.ClientVisible = true; } }
protected void gvSection4_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { GridViewDataColumn colItem = (GridViewDataColumn)gvSection4.Columns["Item"]; DevExpress.Web.ASPxEditors.ASPxComboBox ddlGroup4 = (DevExpress.Web.ASPxEditors.ASPxComboBox)gvSection4.FindRowCellTemplateControl(e.VisibleIndex, colItem, "ddlGroup4"); GridViewDataColumn colSeq = (GridViewDataColumn)gvSection4.Columns["Seq"]; DevExpress.Web.ASPxEditors.ASPxLabel lblGroupID = (DevExpress.Web.ASPxEditors.ASPxLabel)gvSection4.FindRowCellTemplateControl(e.VisibleIndex, colSeq, "lblGroupID"); DevExpress.Web.ASPxEditors.ASPxLabel lblSeq = (DevExpress.Web.ASPxEditors.ASPxLabel)gvSection4.FindRowCellTemplateControl(e.VisibleIndex, colSeq, "lblSeq"); string id = lblGroupID.Text; OPM_BL.SetDDLJDSUBGROP34(ddlGroup4, 4); if (id != "") { ddlGroup4.Value = id; } else { ddlGroup4.SelectedIndex = 0; } usercontrol_JDUserControl JDUserControl1 = (usercontrol_JDUserControl)gvSection4.FindRowCellTemplateControl(e.VisibleIndex, colItem, "JDUserControl1"); DataTable JDDT = (DataTable)gvSection4.DataSource; if (JDDT != null) { DataRow JDDR = JDDT.Rows[e.VisibleIndex]; if (Convert.IsDBNull(JDDR["DT"]) == false) { DataTable JDDTReSeq = (DataTable)JDDR["DT"]; for (int i = 0; i <= JDDTReSeq.Rows.Count - 1; i++) { string seq = (i + 1).ToString(); if (lblSeq.Text != "") { seq = lblSeq.Text + "." + (i + 1); } JDDTReSeq.Rows[i]["Seq"] = seq; } JDUserControl1.JDDescription = JDDTReSeq; } } } }
protected void grid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != GridViewRowType.Data) return; String TYPE_NAME = e.GetValue("TYPE_NAME").ToString(); if (TYPE_NAME != LastTypeName) { //LastTypeName = TYPE_NAME; } else { } }
protected void gvLINE_COND_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Footer) { GridViewDataColumn colItem = (GridViewDataColumn)gvLINE_COND.Columns["SCORE"]; ASPxSpinEdit txtTotalGetScore = (ASPxSpinEdit)gvLINE_COND.FindFooterCellTemplateControl(colItem, "txtTotalGetScore"); ASPxSpinEdit txtTotalMaxScore = (ASPxSpinEdit)gvLINE_COND.FindFooterCellTemplateControl(colItem, "txtTotalMaxScore"); Double SUM_MAX = getTotalMaxScore(); txtTotalMaxScore.Text = SUM_MAX.ToString(); Double SUM = getTotalScore(); //Double SUM_PASS = getTotalPassScore(); txtTotalGetScore.Text = SUM.ToString(); txtTotalGetScore.ForeColor = Color.Black; //if (SUM >= SUM_PASS) // txtTotalGetScore.ForeColor = Color.Green; //else // txtTotalGetScore.ForeColor = Color.Red; // เชค mode View Or Edit if (Request.QueryString["m"].ToString() == "View") { txtTotalGetScore.Enabled = false; txtTotalGetScore.ForeColor = ColorTranslator.FromHtml("#000000"); txtTotalGetScore.BackColor = ColorTranslator.FromHtml("#DDDDDD"); txtTotalMaxScore.Enabled = false; txtTotalMaxScore.ForeColor = ColorTranslator.FromHtml("#000000"); txtTotalMaxScore.BackColor = ColorTranslator.FromHtml("#DDDDDD"); } else { txtTotalGetScore.Enabled = true; txtTotalGetScore.ForeColor = ColorTranslator.FromHtml("#000000"); txtTotalGetScore.BackColor = ColorTranslator.FromHtml("#ffffff"); txtTotalMaxScore.Enabled = true; txtTotalMaxScore.ForeColor = ColorTranslator.FromHtml("#000000"); txtTotalMaxScore.BackColor = ColorTranslator.FromHtml("#ffffff"); } } }
protected void gridSearchView_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return; switch (Convert.ToInt32(e.GetValue("significance"))) { case 1: { e.Row.BackColor = Color.SandyBrown; break; } case 2: { e.Row.BackColor = Color.Salmon; break; } } }
protected void gv_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { GridViewDataColumn colTIME_CODE = (GridViewDataColumn)gv.Columns["full_name"]; DevExpress.Web.ASPxEditors.ASPxLabel ctlTIME_CODE = (DevExpress.Web.ASPxEditors.ASPxLabel)gv.FindRowCellTemplateControl(e.VisibleIndex, colTIME_CODE, "lblTimeCode"); GridViewDataColumn colTimeCome = (GridViewDataColumn)gv.Columns["TIME_COME"]; DevExpress.Web.ASPxEditors.ASPxLabel ctlTIME_COME = (DevExpress.Web.ASPxEditors.ASPxLabel)gv.FindRowCellTemplateControl(e.VisibleIndex, colTimeCome, "ctlTIME_COME"); if (ctlTIME_COME.Text.Trim() != "") { DevExpress.Web.ASPxEditors.ASPxSpinEdit ctlTIME_COME_H = (DevExpress.Web.ASPxEditors.ASPxSpinEdit)gv.FindRowCellTemplateControl(e.VisibleIndex, colTimeCome, "ctlTIME_COME_H"); DevExpress.Web.ASPxEditors.ASPxSpinEdit ctlTIME_COME_M = (DevExpress.Web.ASPxEditors.ASPxSpinEdit)gv.FindRowCellTemplateControl(e.VisibleIndex, colTimeCome, "ctlTIME_COME_M"); PrepareDataEdit(ctlTIME_COME, ctlTIME_COME_H, ctlTIME_COME_M, ctlTIME_CODE.Text); } //เวลากลับ GridViewDataColumn colTimeBack = (GridViewDataColumn)gv.Columns["TIME_BACK"]; DevExpress.Web.ASPxEditors.ASPxLabel ctlTIME_BACK = (DevExpress.Web.ASPxEditors.ASPxLabel)gv.FindRowCellTemplateControl(e.VisibleIndex, colTimeBack, "ctlTIME_BACK"); if (ctlTIME_BACK.Text.Trim() != "") { DevExpress.Web.ASPxEditors.ASPxSpinEdit ctlTIME_BACK_H = (DevExpress.Web.ASPxEditors.ASPxSpinEdit)gv.FindRowCellTemplateControl(e.VisibleIndex, colTimeBack, "ctlTIME_BACK_H"); DevExpress.Web.ASPxEditors.ASPxSpinEdit ctlTIME_BACK_M = (DevExpress.Web.ASPxEditors.ASPxSpinEdit)gv.FindRowCellTemplateControl(e.VisibleIndex, colTimeBack, "ctlTIME_BACK_M"); PrepareDataEdit(ctlTIME_BACK, ctlTIME_BACK_H, ctlTIME_BACK_M, ctlTIME_CODE.Text); } } }
protected void gvProject_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { GridViewDataColumn colItem = (GridViewDataColumn)gvProject.Columns["Project"]; DevExpress.Web.ASPxEditors.ASPxLabel lblSeq = (DevExpress.Web.ASPxEditors.ASPxLabel)gvProject.FindRowCellTemplateControl(e.VisibleIndex, colItem, "lblSeq"); TextBox txtProject_Name = (TextBox)gvProject.FindRowCellTemplateControl(e.VisibleIndex, colItem, "txtProject_Name"); TextBox txtProject_Desc = (TextBox)gvProject.FindRowCellTemplateControl(e.VisibleIndex, colItem, "txtProject_Desc"); TextBox txtProject_Recomment = (TextBox)gvProject.FindRowCellTemplateControl(e.VisibleIndex, colItem, "txtProject_Recomment"); Button btnDeleteProject = (Button)gvProject.FindRowCellTemplateControl(e.VisibleIndex, colItem, "btnDeleteProject"); usercontrol_ProjectTeamUserControl ProjectTeam = (usercontrol_ProjectTeamUserControl)gvProject.FindRowCellTemplateControl(e.VisibleIndex, colItem, "ProjectTeam"); DataTable PJDT = (DataTable)gvProject.DataSource; if (PJDT != null) { DataRow PJDR = PJDT.Rows[e.VisibleIndex]; if (Convert.IsDBNull(PJDR["PROJ_NAME"]) == false) { txtProject_Name.Text = PJDR["PROJ_NAME"].ToString(); } if (Convert.IsDBNull(PJDR["PROJ_DESCRIPTION"]) == false) { txtProject_Desc.Text = PJDR["PROJ_DESCRIPTION"].ToString(); } if (Convert.IsDBNull(PJDR["RECOMMENT"]) == false) { txtProject_Recomment.Text = PJDR["RECOMMENT"].ToString(); } if (Convert.IsDBNull(PJDR["PJTeamDT"]) == false) { DataTable DTReSeq = (DataTable)PJDR["PJTeamDT"]; for (int i = 0; i <= DTReSeq.Rows.Count - 1; i++) { string seq = (i + 1).ToString() + ")"; DTReSeq.Rows[i]["Seq"] = seq; } ProjectTeam.Description = DTReSeq; } } // เชค mode View Or Edit if (Request.QueryString["m"].ToString() == "View") { btnDeleteProject.Visible = false; txtProject_Name.Enabled = false; txtProject_Name.ForeColor = ColorTranslator.FromHtml("#000000"); txtProject_Name.BackColor = ColorTranslator.FromHtml("#DDDDDD"); txtProject_Desc.Enabled = false; txtProject_Desc.ForeColor = ColorTranslator.FromHtml("#000000"); txtProject_Desc.BackColor = ColorTranslator.FromHtml("#DDDDDD"); txtProject_Recomment.Enabled = false; txtProject_Recomment.ForeColor = ColorTranslator.FromHtml("#000000"); txtProject_Recomment.BackColor = ColorTranslator.FromHtml("#DDDDDD"); } else { btnDeleteProject.Visible = true; txtProject_Name.Enabled = true; txtProject_Name.ForeColor = ColorTranslator.FromHtml("#000000"); txtProject_Name.BackColor = ColorTranslator.FromHtml("#ffffff"); txtProject_Desc.Enabled = true; txtProject_Desc.ForeColor = ColorTranslator.FromHtml("#000000"); txtProject_Desc.BackColor = ColorTranslator.FromHtml("#ffffff"); txtProject_Recomment.Enabled = true; txtProject_Recomment.ForeColor = ColorTranslator.FromHtml("#000000"); txtProject_Recomment.BackColor = ColorTranslator.FromHtml("#ffffff"); } } }
protected void gvLINE_COND_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Footer) { GridViewDataColumn colItem = (GridViewDataColumn)gvLINE_COND.Columns["SCORE"]; ASPxSpinEdit txtTotalGetScore = (ASPxSpinEdit)gvLINE_COND.FindFooterCellTemplateControl(colItem, "txtTotalGetScore"); ASPxSpinEdit txtTotalMaxScore = (ASPxSpinEdit)gvLINE_COND.FindFooterCellTemplateControl(colItem, "txtTotalMaxScore"); Double SUM_MAX = getTotalMaxScore(); txtTotalMaxScore.Text = SUM_MAX.ToString(); Double SUM = getTotalScore(); //Double SUM_PASS = getTotalPassScore(); txtTotalGetScore.Text = SUM.ToString(); txtTotalGetScore.ForeColor = Color.Black; //if (SUM >= SUM_PASS) // txtTotalGetScore.ForeColor = Color.Green; //else // txtTotalGetScore.ForeColor = Color.Red; } }
//protected void ProcTree_VirtualModeNodeCreating(object sender, TreeListVirtualModeNodeCreatingEventArgs e) //{ // Procs rowView = e.NodeObject as Procs; // if (rowView == null) return; // e.NodeKeyValue = rowView.Pid1; // e.SetNodeValue("Name", rowView.Name); // e.SetNodeValue("PID", rowView.Pid1); // e.SetNodeValue("ThrCount", rowView.Count); //} //protected void ProcTree_VirtualModeCreateChildren(object sender, TreeListVirtualModeCreateChildrenEventArgs e) //{ // List<Procs> children = null; // Procs parent = e.NodeObject as Procs; // if (parent == null) // { // children = TreeViewBuilder.GetProcTableViewByParentId((int)Session["rsch"], 0); // if (children.Count == 0) ProcTreeList.ClearNodes(); // } // else // { // children = TreeViewBuilder.GetProcTableViewByParentId((int)Session["rsch"], (int)parent.Pid1); // } // e.Children = children; //} protected void gvPorts_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return; PortList pl = ResearchManager.GetPortList((long)e.KeyValue); if (pl != null) { switch (pl.status) { case "Ожидает входящих соединений.": { e.Row.BackColor = Color.PeachPuff; break; } case "Соединение установлено.": { e.Row.BackColor = Color.Pink; break; } default: { break; } } } }
protected void gdvEstoque_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { int quantidadeAtual = 0; ENEstoque estoque = null; if (e.KeyValue != null) { estoque = (new BUEstoque()).GetProdutosByIdFromEstoque(e.KeyValue.ToString()); } if (estoque != null) { quantidadeAtual = estoque.QuantidadeEntrada - estoque.QuantidadeVendida; if (quantidadeAtual <= 5) { e.Row.ForeColor = Color.Red; } } }
/// <summary> /// hide link to documents if no document folder linked to order /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gridOrder_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType != DevExpress.Web.ASPxGridView.GridViewRowType.Data) return; int _docs = e.GetValue("document_folder") != null? (int)e.GetValue("document_folder"): 0; DevExpress.Web.ASPxEditors.ASPxButton _obj = this.gridOrder.FindRowCellTemplateControl(e.VisibleIndex, null, "dxbtnDocs") as DevExpress.Web.ASPxEditors.ASPxButton; if (_obj != null) { //set clientside functionality here as we need to pass document folder id to javascript function _obj.Visible = _docs > 0? true: false; _obj.ClientSideEvents.Click = string.Format("function(s, e) {{ onViewDocuments('{0}'); }}", _docs.ToString()); } }
protected void gv_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { if (e.RowType == GridViewRowType.Data) { GridViewDataColumn colItem = (GridViewDataColumn)gv.Columns["Item"]; DevExpress.Web.ASPxEditors.ASPxComboBox ddlItem = (DevExpress.Web.ASPxEditors.ASPxComboBox)gv.FindRowCellTemplateControl(e.VisibleIndex, colItem, "ddlItem"); DevExpress.Web.ASPxEditors.ASPxLabel lblItem = (DevExpress.Web.ASPxEditors.ASPxLabel)gv.FindRowCellTemplateControl(e.VisibleIndex, colItem, "lblItem"); GridViewDataColumn colScore = (GridViewDataColumn)gv.Columns["Score"]; DevExpress.Web.ASPxEditors.ASPxComboBox ddlScore = (DevExpress.Web.ASPxEditors.ASPxComboBox)gv.FindRowCellTemplateControl(e.VisibleIndex, colScore, "ddlScore"); DevExpress.Web.ASPxEditors.ASPxLabel lblScore = (DevExpress.Web.ASPxEditors.ASPxLabel)gv.FindRowCellTemplateControl(e.VisibleIndex, colScore, "lblScore"); string ItemID = lblItem.Text; string scoreID = lblScore.Text; OPM_BL.SetDDLJDEVALITEM(ddlItem, _TypeID); if (ItemID != "") { ddlItem.Value = ItemID; } else { ddlItem.SelectedIndex = 0; } OPM_BL.SetDDLJDEVALSCORE(ddlScore); if (scoreID != "0") { ddlScore.Value = scoreID; } else { ddlScore.SelectedIndex = 0; } } }
/// <summary> /// An cac row co IsDisabled bang true /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void gridRoster_OnHtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { try { if (e.RowType == GridViewRowType.Data) { e.Row.Visible = !Boolean.Parse(e.GetValue("IsDisabled").ToString()); } } catch (Exception ex) { LoggerController.WriteLog(System.Runtime.InteropServices.Marshal.GetExceptionCode(), ex, Network.GetIpClient()); } }