Exemplo n.º 1
0
        //used for testing
        private void menuItem43_Click(object sender, EventArgs e)
        {
            this.scheduleControl1.NavigationPanelFillWithCalendar = true;

            //change the look of the AlertWindow....
            this.scheduleControl1.AlertWindow.BackColor = Color.FromArgb(240, 240, 255);
            this.scheduleControl1.AlertWindow.Grid.TableStyle.BackColor       = Color.FromArgb(100, 240, 240, 255);
            this.scheduleControl1.AlertWindow.Grid.Properties.BackgroundColor = Color.FromArgb(100, Color.Blue);
            Syncfusion.Windows.Forms.Grid.GridStyleInfo headerStyle =
                this.scheduleControl1.AlertWindow.Grid.BaseStylesMap["Header"].StyleInfo;
            headerStyle.Interior = new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.Vertical, Color.Blue, Color.White);
            this.scheduleControl1.AlertWindow.Grid.Refresh();
            MessageBox.Show("Test process successed");
        }
Exemplo n.º 2
0
        protected override void OnDraw(System.Drawing.Graphics g, System.Drawing.Rectangle clientRectangle, int rowIndex, int colIndex, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
        {
            if (clientRectangle.IsEmpty)
            {
                return;
            }

            int       imageIndex = style.ImageIndex;
            ImageList imageList  = style.ImageList;

            if (imageIndex != -1 && imageList != null && imageIndex < imageList.Images.Count)
            {
                try
                {
                    Rectangle rect = GetCellBoundsCore(rowIndex, colIndex);
                    int       X    = rect.X + IndentSize * (int)style.Tag;
                    if (this.Grid.Model[rowIndex, 5].CellValue.ToString() == "Directory")
                    {
                        g.DrawImage((Bitmap)imageList.Images[imageIndex], X, rect.Y);
                    }
                    //now draw text past the image...
                    bool   drawDisabled = false;
                    string displayText  = String.Empty;

                    X += imageList.Images[imageIndex].Width + 2;


                    if (this.Grid.Model[rowIndex, 5].CellValue.ToString() == "Directory")
                    {
                        int imageIndex3 = imageIndex + 3;
                        g.DrawImage((Bitmap)imageList.Images[imageIndex3], X, rect.Y);
                        X += imageList.Images[imageIndex3].Width + 2;
                    }
                    if (this.Grid.Model[rowIndex, 5].CellValue.ToString() == "File")
                    {
                        int imageIndex4 = 5;
                        g.DrawImage((Bitmap)imageList.Images[imageIndex4], X, rect.Y);
                        X += imageList.Images[imageIndex4].Width + 2;
                    }

                    Rectangle textRectangle = RemoveMargins(clientRectangle, style);
                    int       shift         = X - textRectangle.X;
                    textRectangle.X      = X;
                    textRectangle.Width -= shift;
                    if (textRectangle.IsEmpty)
                    {
                        return;
                    }

                    try
                    {
                        displayText = Model.GetFormattedOrActiveTextAt(rowIndex, colIndex, style);
                    }
                    catch
                    {
                        displayText = style.Text;
                        //style.ToolTip = ex.Message;
                        drawDisabled = true;
                    }

                    if (style.HasError)
                    {
                        displayText  = style.Error;
                        drawDisabled = true;
                    }

                    if (displayText.Length > 0)
                    {
                        Font  font      = style.Font.GdipFont;
                        Color textColor = Grid.Model.Properties.BlackWhite ? Color.Black : style.TextColor;
                        DrawText(g, displayText, font, textRectangle, style, textColor, drawDisabled);
                    }
                }
                catch { }
            }
        }
Exemplo n.º 3
0
        public override void DrawButton(System.Drawing.Graphics g, System.Drawing.Rectangle rect, System.Windows.Forms.ButtonState buttonState, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
        {
            ControlPaint.DrawButton(g, rect, buttonState);

            // Icon
            rect.Inflate(-3, -3);
            Syncfusion.Drawing.BrushPaint.FillRectangle(g, rect, new Syncfusion.Drawing.BrushInfo(Syncfusion.Drawing.GradientStyle.PathEllipse, Color.Black, Color.Wheat));
        }
Exemplo n.º 4
0
        protected override void OnDraw(System.Drawing.Graphics g, System.Drawing.Rectangle clientRectangle, int rowIndex, int colIndex, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
        {
            if (clientRectangle.IsEmpty)
            {
                return;
            }


            if (style.Tag is Bitmap)
            {
                g.DrawImage((Bitmap)style.Tag, clientRectangle);
            }
        }
Exemplo n.º 5
0
        protected override void OnDraw(System.Drawing.Graphics g, System.Drawing.Rectangle clientRectangle, int rowIndex, int colIndex, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
        {
            style.Font.Underline = true;

            if (_drawHotLink)
            {
                style.TextColor = ActiveLinkColor;
            }
            base.OnDraw(g, clientRectangle, rowIndex, colIndex, style);
        }
Exemplo n.º 6
0
 //handle drawing the cell
 protected override void OnDraw(System.Drawing.Graphics g, System.Drawing.Rectangle clientRectangle, int rowIndex, int colIndex, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
 {
     if (Grid.CurrentCell.HasCurrentCellAt(rowIndex, colIndex) && CurrentCell.IsEditing)
     {
         dateTimePicker.Size         = clientRectangle.Size;
         dateTimePicker.CustomFormat = style.Format;
         dateTimePicker.Font         = style.GdipFont;
         dateTimePicker.Location     = clientRectangle.Location;
         dateTimePicker.Style        = Syncfusion.Windows.Forms.VisualStyle.Office2007;
         dateTimePicker.Show();
         //if (!dateTimePicker.ContainsFocus)
         //dateTimePicker.Focus();
     }
     else
     {
         style.TextMargins.Left = 3;                 //avoid the little jump...
         base.OnDraw(g, clientRectangle, rowIndex, colIndex, style);
     }
 }
Exemplo n.º 7
0
        protected override void OnDraw(System.Drawing.Graphics g, System.Drawing.Rectangle clientRectangle, int rowIndex, int colIndex, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
        {
            if (this.ShouldDrawFocused(rowIndex, colIndex))
            {
                if (style.Control is CellEmbeddedGrid)
                {
                    activeGrid = (CellEmbeddedGrid)style.Control;
                }

                base.OnDraw(g, clientRectangle, rowIndex, colIndex, style);
            }
            else
            {
                // Draw a static grid
                if (style.Control is CellEmbeddedGrid)
                {
                    CellEmbeddedGrid grid = (CellEmbeddedGrid)style.Control;
                    grid.DrawGrid(g, clientRectangle, true);
                }
            }
        }
Exemplo n.º 8
0
        /// <override/>
        protected override void OnDrawCellButton(GridCellButton button, Graphics g, int rowIndex, int colIndex, bool bActive, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
        {
            Node n = this.treeHelper.GetNode(rowIndex);

            if (!n.HasChildren)
            {
                return;
            }

            base.OnDrawCellButton(button, g, rowIndex, colIndex, bActive, style);
        }
Exemplo n.º 9
0
        /// <override/>
        public override void Draw(System.Drawing.Graphics g, System.Drawing.Rectangle cellRectangle, int rowIndex, int colIndex, Syncfusion.Windows.Forms.Grid.GridStyleInfo style)
        {
            Node n      = this.treeHelper.GetNode(rowIndex);
            int  indent = (n.Indent + 1) * offSet + this.midPt + this.leftSide + 2;

            style.TextMargins.Left    = indent;
            style.HorizontalAlignment = GridHorizontalAlignment.Left;
            base.Draw(g, cellRectangle, rowIndex, colIndex, style);

            DrawTreeLines(g, rowIndex, this.GetButton(0).Bounds);
        }