void treeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            var record = e.Node.Tag as ProtocolRecord;

            if (e.EditPainter != null)
            {
                e.Appearance.FillRectangle(e.Cache, e.Bounds);
                DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs c =
                    new DevExpress.XtraEditors.Drawing.ControlGraphicsInfoArgs(e.EditViewInfo, e.Cache, e.EditViewInfo.Bounds);
                e.EditPainter.Draw(c);

                var commonPen   = Pens.LightBlue;
                var requiredPen = Pens.Red;
                var donePen     = Pens.Green;
                if (!e.Column.Name.Equals("Type") && record.Type.Type != TypeEnum.Complex)
                {
                    var temp = record.Type;
                    while (temp._parent != null)
                    {
                        temp = record.Type._parent;
                    }
                    var required = temp.IsRequired;

                    var hasValue = !string.IsNullOrEmpty(e.CellText);

                    e.Graphics.DrawRectangle(required ? (hasValue ? donePen : requiredPen) : commonPen, e.EditViewInfo.BorderRect);
                }
                else
                {
                    e.Graphics.DrawRectangle(commonPen, e.EditViewInfo.BorderRect);
                }

                e.Handled = true;
            }
        }
 private void treeView_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     //if( e.Node.Id == 1 )
     //{
     //   e.Appearance.Font = new System.Drawing.Font( e.Appearance.Font, FontStyle.Bold );
     //}
 }
 void treeView_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     if (e.Node.Id == 1)
     {
         e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
     }
 }
Example #4
0
        private void treeListEx1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Column.ColumnType.Name == "Decimal")
            {
                decimal d = ToolKit.ParseDecimal(e.CellValue);

                if (d == 0)
                {
                    e.CellText = string.Empty;
                }
                else
                {
                    e.CellText = d.ToString("N2");
                }
            }

            //特殊处理显示模式 仅清单 和 列表模式
            if (this.m_DisplayType == 0)
            {
                //所有结构处理
                this.dispalyAll(e);
            }
            else
            {
                dispalyOnlyQD(e);
            }
        }
Example #5
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.GetValue(0).GetType().Equals(typeof(ReturnShopObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;

                e.Appearance.BackColor = ((ReturnShopObj)e.CellValue).IsCommitPresent() ? Color.LightGreen : Color.LightPink;

                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(ReturnObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;

                e.Appearance.BackColor = ((ReturnObj)e.CellValue).ReturnStateId == 2 ? Color.LightGreen : Color.LightPink;

                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
        }
Example #6
0
        private void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Column == colSize)
            {
                if (e.Node.GetDisplayText("Type") == "File")
                {
                    e.Appearance.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Far;
                    e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Italic);
                    Int64 size = Convert.ToInt64(e.Node.GetValue("Size"));
                    if (size >= 1024)
                    {
                        e.CellText = string.Format("{0:### ### ###} KB", size / 1024);
                    }
                    else
                    {
                        e.CellText = string.Format("{0} Bytes", size);
                    }
                }
                else
                {
                    e.CellText = String.Format("<{0}>", e.Node.GetDisplayText("Type"));
                }
            }

            if (e.Column == colName)
            {
                if (e.Node.GetDisplayText("Type") == "File")
                {
                    e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
                }
            }
        }
Example #7
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.GetValue(0).GetType().Equals(typeof(OrderShopObj)))
            {
                e.Appearance.BackColor = Color.Empty;
                var oh = (OrderShopObj)e.CellValue;
                if (((Orders)oh.Orders).IsExistInState(2))
                {
                    e.Appearance.BackColor = Color.LightGreen;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(OrderHeaderObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;
                var oh = (OrderHeaderObj)e.CellValue;

                if (oh != null)
                {
                    e.Appearance.BackColor = oh.IdOrderState != 2 ? Color.LightPink : Color.LightGreen;
                    e.Appearance.BackColor = oh.Locked ? Color.Violet : e.Appearance.BackColor;
                }
                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
        }
Example #8
0
        void treeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (FindListIsEmpty)
            {
                return;
            }

            int filterTextIndex = e.CellText.IndexOf(filterCellText, StringComparison.CurrentCultureIgnoreCase);

            if (filterTextIndex == -1)
            {
                return;
            }
            TreeCell temp = new TreeCell(e.Node.Id, e.Column);

            if (NeedHighLight(temp))
            {
                using (SolidBrush brush = new SolidBrush(BackGroundColor)) {
                    e.Cache.FillRectangle(brush, e.Bounds);
                }
            }


            TextEditViewInfo tevi = e.EditViewInfo as TextEditViewInfo;

            if (tevi == null)
            {
                return;
            }
            e.Appearance.BackColor = Color.Empty;
            e.Cache.Paint.DrawMultiColorString(e.Cache, tevi.MaskBoxRect, e.CellText, filterCellText, e.Appearance, e.Appearance.ForeColor, HighLightColor, false, filterTextIndex);
            e.Handled = true;
        }
Example #9
0
 private void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     //if (DesignTimeTools.IsDesignMode) return;
     //if (e.Column == colName)
     //{
     //    string textColor = GetHtmlTextColor(treeList1.FocusedNode.Equals(e.Node));
     //    object textValue = e.Node.GetValue(colName);
     //    e.CellText = string.Format("<Color={1}>{0}", textValue, textColor);
     //    if (e.Node.ParentNode == null || !(DataHelper.ShowAllMessageCount || DataHelper.ShowUnreadMessageCount)) return;
     //    List<User> list = e.Node.GetValue(colData) as List<User>;
     //    int unread = GetUnreadMessagesCount(list);
     //    if (unread > 0 && DataHelper.ShowUnreadMessageCount)
     //    {
     //        if (DataHelper.ShowAllMessageCount)
     //            e.CellText = string.Format("<Color={5}><b>{0}</b><Size=-1><Color={2}> [{1}/<Color={4}>{3}<Color={2}>]", textValue, unread, ColorHelper.HtmlQuestionColor, list.Count, ColorHelper.HtmlWarningColor, textColor);
     //        else
     //            e.CellText = string.Format("<Color={3}><b>{0}</b><Size=-1><Color={2}> [{1}]", textValue, unread, ColorHelper.HtmlQuestionColor, textColor);
     //    }
     //    else
     //    {
     //        if (DataHelper.ShowAllMessageCount && list.Count > 0)
     //            e.CellText = string.Format("<Color={3}>{0}<Size=-1><Color={2}> [{1}]", textValue, list.Count, ColorHelper.HtmlWarningColor, textColor);
     //    }
     //}
 }
Example #10
0
        private void dxTreeViewCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (!Selection.Contains(e.Node))
            {
                return;
            }

            var brush = getSolidBrush(SystemColors.Window);

            e.Graphics.FillRectangle(brush, e.Bounds);

            var highlightBrush = getSolidBrush(SystemColors.Highlight);
            var measureString  = e.Graphics.MeasureString(e.CellText, e.Appearance.Font);
            var stringTop      = e.Bounds.Y + Convert.ToInt32((e.Bounds.Height - measureString.Height) / 2);

            var stringRectangle = new Rectangle(e.EditViewInfo.ContentRect.Left, stringTop,
                                                Convert.ToInt32(measureString.Width + 1),
                                                Convert.ToInt32(measureString.Height));

            e.Graphics.FillRectangle(highlightBrush, stringRectangle);

            SolidBrush textBrush = getSolidBrush(SystemColors.HighlightText);

            e.Graphics.DrawString(e.CellText, e.Appearance.Font, textBrush, stringRectangle);
            e.Handled = true;
        }
Example #11
0
 private void resourcesTree1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     if (schedulerControl1.Storage != null)
     {
         Resource resource = schedulerControl1.Storage.Resources.Items.Find(r => r.Caption == e.CellText);
         e.Appearance.BackColor = resource.GetColor();
     }
 }
Example #12
0
 void BaseTreeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     if (e.Node == this.FocusedNode)
     {
         e.Appearance.BackColor = Color.Blue;
         e.Appearance.ForeColor = Color.White;
     }
 }
Example #13
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.GetValue(0).GetType().Equals(typeof(ShopData)))
            {
                e.Appearance.BackColor = Color.Empty;
                var oh = (ShopData)e.CellValue;
                if (oh.ObjectList.IsExistInState(2))
                {
                    e.Appearance.BackColor = Color.LightGreen;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(PreShopData)))
            {
                e.Appearance.BackColor = Color.Empty;
                var oh = (PreShopData)e.CellValue;
                if (oh.ObjectList.IsExistInState(2))
                {
                    e.Appearance.BackColor = Color.LightGreen;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(OrderHeaderData)))
            {
                e.Appearance.BackColor2 = Color.Empty;
                var oh = (OrderHeaderData)e.CellValue;

                if (oh != null)
                {
                    e.Appearance.BackColor = oh.IdOrderState != 2 ? Color.LightPink : Color.LightGreen;
                }
                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(PreOrderHeaderData)))
            {
                e.Appearance.BackColor2 = Color.Empty;
                var oh = (PreOrderHeaderData)e.CellValue;

                if (oh != null)
                {
                    e.Appearance.BackColor = oh.IdOrderState != 2 ? Color.LightPink : Color.LightGreen;
                }
                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
        }
        private void TreeProjectFiles_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (treeProjectFiles.GetDataRecordByNode(e.Node) is not BaseFileSystemTreeNode node)
            {
                return;
            }

            if (node is DirectoryTreeNode)
            {
                e.Appearance.FontStyleDelta = FontStyle.Bold;
            }
        }
        void DrawNodeElementAsColumn(CustomDrawNodeCellEventArgs e)
        {
            HeaderObjectInfoArgs infoArgs = new HeaderObjectInfoArgs();

            infoArgs.Bounds      = Rectangle.Inflate(e.Bounds, -1, 0);
            infoArgs.Cache       = e.Cache;
            infoArgs.Caption     = e.CellText;
            infoArgs.CaptionRect = e.Bounds;
            infoArgs.TopLeft     = new Point(infoArgs.CaptionRect.X, infoArgs.CaptionRect.Y + 3);
            customCellPainter.DrawObject(infoArgs);
            e.Handled = true;
        }
Example #16
0
        void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            ABCCommonTreeListNode obj = (ABCCommonTreeListNode)treeList1.GetDataRecordByNode(e.Node);

            if (obj == null || (DataStructInfo)obj.InnerData == null)
            {
                return;
            }
            if (((DataStructInfo)obj.InnerData).Selected)
            {
                e.Appearance.Font = new Font(e.Appearance.Font, e.Appearance.Font.Style | FontStyle.Bold);
            }
        }
 /// <summary>
 /// Handles the CustomDrawNodeCell event of the treeList control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="CustomDrawNodeCellEventArgs"/> instance containing the event data.</param>
 private void treeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     if (!(e.CellValue is decimal))
     {
         return;
     }
     if ((decimal)e.CellValue != 0)
     {
         return;
     }
     e.Appearance.FillRectangle(e.Cache, e.Bounds);
     e.Handled = true;
 }
Example #18
0
        private void tlDetail_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.CellValue == null)
            {
                return;
            }
            decimal value = -1;

            if (decimal.TryParse(e.CellValue.ToString(), out value) && value == 0)
            {
                e.CellText = string.Empty;
            }
        }
Example #19
0
        void treeBinding_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            ABCCommonTreeListNode obj = (ABCCommonTreeListNode)treeBinding.GetDataRecordByNode(e.Node);

            if (obj == null || (ABCScreen.ABCBindingConfig)obj.InnerData == null)
            {
                return;
            }

            if (((ABCScreen.ABCBindingConfig)obj.InnerData).IsMainObject)
            {
                e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
            }
        }
Example #20
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)//изменено
        {
            if (e.Node.GetValue(0).GetType().Equals(typeof(PreOrderHeaderObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;

                e.Appearance.BackColor = ((PreOrderHeaderObj)e.CellValue).IdOrderState == 1 ? Color.LightGreen : Color.LightPink;

                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
        }
        void BandsColumnTreeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            GridBand band = e.Node[0] as GridBand;

            if (band != null && !band.Visible)
            {
                DrawNodeElementAsColumn(e);
            }

            BandedGridColumn gridColumn = e.Node[0] as BandedGridColumn;

            if (gridColumn != null && (!gridColumn.Visible || gridColumn.OwnerBand == null))
            {
                DrawNodeElementAsColumn(e);
            }
        }
        void _TreeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            int index = e.CellText.IndexOf(Text, 0);

            if (index >= 0)
            {
                e.Handled = true;
                if (e.Node.Focused && e.Column.FieldName == FieldName)
                {
                    paint.DrawMultiColorString(e.Cache, e.Bounds, e.CellText, Text, e.Appearance, Color.Red, Color.Yellow, false, index);
                }
                else
                {
                    paint.DrawMultiColorString(e.Cache, e.Bounds, e.CellText, Text, e.Appearance, Color.Blue, e.Appearance.GetBackColor(), false, index);
                }
            }
        }
Example #23
0
        private void DrawButtons(CustomDrawNodeCellEventArgs e)
        {
            ButtonEditViewInfo viewInfo = e.EditViewInfo as ButtonEditViewInfo;

            if (viewInfo != null)
            {
                foreach (EditorButtonObjectInfoArgs args in viewInfo.LeftButtons)
                {
                    args.Cache = e.Cache;
                    viewInfo.EditorButtonPainter.DrawObject(args);
                }
                foreach (EditorButtonObjectInfoArgs args in viewInfo.RightButtons)
                {
                    args.Cache = e.Cache;
                    viewInfo.EditorButtonPainter.DrawObject(args);
                }
            }
        }
Example #24
0
        /// <summary>
        /// 关联变色
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void treeList2_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            TreeListNode node = e.Node;

            if (node.Level == 0)
            {
                TypeLabel typeLabel = (TypeLabel)node.Tag;
                if (typeLabel.Ref == AllLabels.GetSelectIds("车"))
                {
                    e.Appearance.ForeColor = Color.Red;
                }
                else if (typeLabel.Ref == AllLabels.GetSelectIds("人"))
                {
                    e.Appearance.ForeColor = Color.Blue;
                }
                return;
            }
        }
Example #25
0
        private void treeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs cdncea)
        {
            // if the tree list node is not enabled set the foreground color (should affect text color and checkbox color)
            if (Convert.ToBoolean(cdncea.Node.GetValue(EnabledFieldName)) == false)
            {
                cdncea.Appearance.ForeColor = Color.Gray;
            }

            // the focused row should have a light blue backgound
            if (cdncea.Focused)
            {
                cdncea.Appearance.BackColor = Color.LightBlue;
            }
            // the selected row (not focused so this row will be the one that was focused when the treelist
            // control was focused) should have a light gray background
            else if (cdncea.Node.Selected)
            {
                cdncea.Appearance.BackColor = Color.LightGray;
            }

            if (cdncea.Node.Level == 0)
            {
                if (OnCustomDrawRootRowNodeCell != null)
                {
                    OnCustomDrawRootRowNodeCell(this, cdncea);
                }
            }

            if (cdncea.Node.HasChildren)
            {
                if (OnCustomDrawGroupRowNodeCell != null)
                {
                    OnCustomDrawGroupRowNodeCell(this, cdncea);
                }
            }
            else
            {
                if (OnCustomDrawDataRowNodeCell != null)
                {
                    OnCustomDrawDataRowNodeCell(this, cdncea);
                }
            }
        }
        private void CustomTreeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            var tl = this;

            if (e.Node == tl.FocusedNode)
            {
                var brush = GetSolidBrush(SystemColors.Window);
                e.Cache.FillRectangle(brush, e.Bounds);
                var highlightBrush = GetSolidBrush(SystemColors.Highlight);
                var R = new Rectangle(e.EditViewInfo.ContentRect.Left, e.EditViewInfo.ContentRect.Top,
                                      Convert.ToInt32(e.Graphics.MeasureString(e.CellText, e.Appearance.Font).Width + 1), e.EditViewInfo.ContentRect.Height);
                e.Cache.FillRectangle(highlightBrush, R);
                var highlightForeBrush = GetSolidBrush(SystemColors.HighlightText);
                var format             = new StringFormat();
                format.LineAlignment = StringAlignment.Center;
                e.Cache.DrawString(e.CellText, e.Appearance.GetFont(), highlightForeBrush, R, format);
                e.Handled = true;
            }
        }
Example #27
0
        private void treeListFBFX_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Column != null)
            {
                switch (e.Column.FieldName)
                {
                case "GCL":
                case "XHL":
                    decimal d = ToolKit.ParseDecimal(e.CellValue);
                    if (d.Equals(0m))
                    {
                        e.CellText = string.Empty;
                    }
                    break;

                default:
                    break;
                }
            }
        }
Example #28
0
        private void tlCcam_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.Level == 0)
            {
                e.Appearance.Font = new Font("맑은 고딕", 9, FontStyle.Bold);
            }
            else if (e.Node.Level == 1 && tlCcam.FocusedNode != e.Node && e.Node.Selected == false)
            {
                e.Appearance.BackColor = Color.White;
            }

            DataRowView dr = tlCcam.GetDataRecordByNode(e.Node) as DataRowView;

            if (dr != null)
            {
                if (dr.Row.RowState != DataRowState.Unchanged)
                {
                    e.Appearance.ForeColor = Color.Red;
                }
            }
        }
        private void tlBoPhan_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e)
        {
            s = e;
            TreeList tree = sender as TreeList;

            if (e.Node == tree.FocusedNode)
            {
                var listnv = db.NhanVien.OrderBy(m => m.Id).ToList();
                lstNV = listnv;
                if (e.CellText != "Bộ phận tổ chức")
                {
                    gcQuanTriNguoiDung.BeginUpdate();
                    var list = (from nv in lstNV
                                join bp in db.BoPhan on nv.MaNhom equals bp.MaNhom
                                where bp.TenNhom == e.CellValue.ToString()
                                select nv).ToList();
                    gcQuanTriNguoiDung.DataSource = new BindingList <NhanVien>(list)
                    {
                        AllowNew = true
                    };
                    gcQuanTriNguoiDung.EndUpdate();
                    btnThem.Enabled = true;
                    var mn = db.BoPhan.FirstOrDefault(m => m.TenNhom == e.CellValue.ToString());
                    manhom = mn.MaNhom;
                    value  = e.CellValue.ToString();
                }
                else
                {
                    gcQuanTriNguoiDung.BeginUpdate();
                    var list = lstNV;
                    gcQuanTriNguoiDung.DataSource = list;
                    gcQuanTriNguoiDung.EndUpdate();
                    btnThem.Enabled = false;
                }
            }
            //for(int i=0;i<gvQuantri.RowCount;i++)
            //{
            //    gvQuantri.SetRowCellValue(i, grcMatKhau, "***********");
            //}
        }
Example #30
0
        private void treeListSingolo_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (IsNum(e.Node.GetValue(this.treeListSingolo.Columns[ColonnaQta])))
            {
                e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
                e.Appearance.ForeColor = Color.Red;
            }

            if (e.Node.HasChildren)
            {
                e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Regular);
                foreach (TreeListNode item in e.Node.Nodes)
                {
                    if (IsNum(item.GetValue(this.treeListSingolo.Columns[ColonnaQta])))
                    {
                        e.Appearance.Font      = new Font(e.Appearance.Font, FontStyle.Bold);
                        e.Appearance.ForeColor = Color.Red;
                        break;
                    }
                }
            }
        }
Example #31
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.GetValue(0).GetType().Equals(typeof (OrderHeaderObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;

                e.Appearance.BackColor = ((OrderHeaderObj) e.CellValue).IdOrderState == 1 ? Color.LightGreen : Color.LightPink;

                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
        }
Example #32
0
 /// <summary>
 /// 设定树中节点背景颜色
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TreeList_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     Brush backBrush, foreBrush;
     if (e.Node != (sender as TreeList).FocusedNode)
     {
         backBrush = new LinearGradientBrush(e.Bounds, Color.PapayaWhip, Color.PeachPuff,
             LinearGradientMode.ForwardDiagonal);
         foreBrush = Brushes.Black;
     }
     else
     {
         backBrush = Brushes.PeachPuff;
         foreBrush = new SolidBrush(Color.Black);
     }
     // Fill the background.
     e.Graphics.FillRectangle(backBrush, e.Bounds);
     // Paint the node value.
     e.Graphics.DrawString(e.CellText, e.Appearance.Font, foreBrush, e.Bounds,
         e.Appearance.GetStringFormat());
     // Prohibit default painting.
     e.Handled = true;
 }
Example #33
0
 private void CustomDrawNodelCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     if (MaterialIds.Count > 0)
     {
         foreach (var id in MaterialIds)
         {
             if (e.Node.GetValue("Material_Id").ToString() == id)
                 e.Appearance.BackColor = Color.Yellow;
         }
     }
     else
     {
         if (MaterialId != 0)
             if (e.Node.GetValue("Material_Id").ToString() == MaterialId.ToString())
                 e.Appearance.BackColor = Color.Green;
     }
 }
 private void treeListPermission_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     bool parentCheck = IsParentChecked(e.Node, e.Column.FieldName);
     e.Appearance.BeginUpdate();
     if (parentCheck)
     {
         e.Appearance.BackColor = Color.DarkGray;
         e.Appearance.Options.UseBackColor = true;
     }
     else
     {
         e.Appearance.Options.UseBackColor = false;
     }
     //e.Handled = true;
     e.Appearance.EndUpdate();
     //  treeListPermission.Refresh();
 }
Example #35
0
 private void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     //if (DesignTimeTools.IsDesignMode) return;
     //if (e.Column == colName)
     //{
     //    string textColor = GetHtmlTextColor(treeList1.FocusedNode.Equals(e.Node));
     //    object textValue = e.Node.GetValue(colName);
     //    e.CellText = string.Format("<Color={1}>{0}", textValue, textColor);
     //    if (e.Node.ParentNode == null || !(DataHelper.ShowAllMessageCount || DataHelper.ShowUnreadMessageCount)) return;
     //    List<User> list = e.Node.GetValue(colData) as List<User>;
     //    int unread = GetUnreadMessagesCount(list);
     //    if (unread > 0 && DataHelper.ShowUnreadMessageCount)
     //    {
     //        if (DataHelper.ShowAllMessageCount)
     //            e.CellText = string.Format("<Color={5}><b>{0}</b><Size=-1><Color={2}> [{1}/<Color={4}>{3}<Color={2}>]", textValue, unread, ColorHelper.HtmlQuestionColor, list.Count, ColorHelper.HtmlWarningColor, textColor);
     //        else
     //            e.CellText = string.Format("<Color={3}><b>{0}</b><Size=-1><Color={2}> [{1}]", textValue, unread, ColorHelper.HtmlQuestionColor, textColor);
     //    }
     //    else
     //    {
     //        if (DataHelper.ShowAllMessageCount && list.Count > 0)
     //            e.CellText = string.Format("<Color={3}>{0}<Size=-1><Color={2}> [{1}]", textValue, list.Count, ColorHelper.HtmlWarningColor, textColor);
     //    }
     //}
 }
Example #36
0
        //����ʱѡ�����ı��λ�����ı���ò�ͬ��ɫ��ʶ����
        private void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (Flag == "")
            {
                return;
            }
            Brush backBrush, foreBrush;
            if (e.Node.GetValue("oldcheck").ToString() != e.Node.GetValue("check").ToString())
            {
                //Color.Bisque
                backBrush = new LinearGradientBrush(e.Bounds, Color.LightYellow, Color.LightYellow, LinearGradientMode.Horizontal);
                foreBrush = new SolidBrush(Color.Black);
                e.Graphics.FillRectangle(backBrush, e.Bounds);
                e.Graphics.DrawString(e.CellText, e.Appearance.Font, foreBrush, e.Bounds, e.Appearance.GetStringFormat());
                e.Handled = true;
            }
            else if ((CheckState)e.Node.GetValue("check") != CheckState.Unchecked && e.Node.GetValue("nowunits").ToString() != e.Node.GetValue("oldunits").ToString())
            {
                backBrush = new LinearGradientBrush(e.Bounds, Color.LightSteelBlue, Color.LightSteelBlue, LinearGradientMode.Horizontal);
                foreBrush = new SolidBrush(Color.Black);
                e.Graphics.FillRectangle(backBrush, e.Bounds);
                e.Graphics.DrawString(e.CellText, e.Appearance.Font, foreBrush, e.Bounds, e.Appearance.GetStringFormat());
                e.Handled = true;
            }
            else
            {
                backBrush = new SolidBrush(Color.DarkBlue);
                foreBrush = new SolidBrush(Color.PeachPuff);

            }
        }
Example #37
0
 private void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
 }
Example #38
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.GetValue(0).GetType().Equals(typeof (ShopData)))
            {
                e.Appearance.BackColor = Color.Empty;
                var oh = (ShopData) e.CellValue;
                if (oh.ObjectList.IsExistInState(2))
                {
                    e.Appearance.BackColor = Color.LightGreen;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof (PreShopData)))
            {
                e.Appearance.BackColor = Color.Empty;
                var oh = (PreShopData) e.CellValue;
                if (oh.ObjectList.IsExistInState(2))
                {
                    e.Appearance.BackColor = Color.LightGreen;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(OrderHeaderData)))
            {
                e.Appearance.BackColor2 = Color.Empty;
                var oh = (OrderHeaderData)e.CellValue;

                if (oh != null)
                {
                    e.Appearance.BackColor = oh.IdOrderState != 2 ? Color.LightPink : Color.LightGreen;
                }
                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof (PreOrderHeaderData)))
            {
                e.Appearance.BackColor2 = Color.Empty;
                var oh = (PreOrderHeaderData) e.CellValue;

                if (oh != null)
                {
                    e.Appearance.BackColor = oh.IdOrderState != 2 ? Color.LightPink : Color.LightGreen;
                }
                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
        }
Example #39
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if (e.Node.GetValue(0).GetType().Equals(typeof(ReturnShopObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;

                e.Appearance.BackColor = ((ReturnShopObj)e.CellValue).IsCommitPresent() ? Color.LightGreen : Color.LightPink;

                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(ReturnObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;

                e.Appearance.BackColor = ((ReturnObj)e.CellValue).ReturnStateId == 2 ? Color.LightGreen : Color.LightPink;

                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
        }
Example #40
0
        private void TreeListCustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            /*
            if (e.Node.GetValue(0).GetType().Equals(typeof(OrderShopObj)))
            {
                e.Appearance.BackColor = Color.Empty;
                var oh = (OrderShopObj)e.CellValue;
                if(((Orders) oh.Orders).IsExistInState(2))
                {
                    e.Appearance.BackColor = Color.LightGreen;
                }
            }

            if (e.Node.GetValue(0).GetType().Equals(typeof(OrderHeaderObj)))
            {
                e.Appearance.BackColor2 = Color.Empty;
                var oh = (OrderHeaderObj)e.CellValue;

                if (oh != null)
                {
                    e.Appearance.BackColor = oh.IdOrderState != 2 ? Color.LightPink : Color.LightGreen;
                    e.Appearance.BackColor = oh.Locked ? Color.Violet : e.Appearance.BackColor;
                }
                if (e.Node.Focused)
                {
                    e.Appearance.BackColor2 = Color.White;
                    return;
                }
            }
             */
        }
Example #41
0
 private void treeList1_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
 {
     // DrawBackGround(e.Node, e);
 }