コード例 #1
0
        private void DrawElement_RowSelectorHeaderUIElement(ref UIElementDrawParams drawParams)
        {
            drawParams.DrawBackColor(drawParams.Element.Rect);

            Border3DSide border = Border3DSide.Bottom | Border3DSide.Right;

            drawParams.DrawBorders(UIElementBorderStyle.Solid, border);
        }
コード例 #2
0
        private void DrawElement_EditorWithComboDropDownButtonUIElement(ref UIElementDrawParams drawParams)
        {
            EditorWithComboDropDownButtonUIElement dropDownButtonElement = (EditorWithComboDropDownButtonUIElement)drawParams.Element;

            if (dropDownButtonElement.Parent is EditorWithComboUIElement)
            {
                EditorWithComboUIElement comboElement = (EditorWithComboUIElement)dropDownButtonElement.Parent;
                UltraGridCell            cell         = (UltraGridCell)comboElement.SelectableItem;
                UltraGridColumn          column       = cell.Column;

                if (this.grid.IsCellEditable(cell) == true)
                {
                    if (dropDownButtonElement.IsHotTracked == true)
                    {
                        drawParams.AppearanceData.BackColor = Color.FromArgb(230, 230, 230);
                        drawParams.DrawBackColor(drawParams.Element.Rect);
                        drawParams.DrawImage(Properties.Resources.button_code_hover, this.GetDropDownButtonRect(drawParams), false, null);
                        drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Left);
                    }
                    else
                    {
                        drawParams.AppearanceData.BackColor = Color.FromArgb(215, 215, 215);
                        drawParams.DrawBackColor(drawParams.Element.Rect);
                        drawParams.DrawImage(Properties.Resources.button_code_normal, this.GetDropDownButtonRect(drawParams), false, null);
                        drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Left);
                    }
                }
                else
                {
                    drawParams.AppearanceData.BackColor = Color.FromArgb(180, 180, 180);
                    drawParams.DrawBackColor(drawParams.Element.Rect);
                    drawParams.DrawImage(Properties.Resources.button_code_normal, this.GetDropDownButtonRect(drawParams), false, null);
                    drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Left);
                }
            }
        }
コード例 #3
0
        private void DrawElement_RowSelectorUIElement(ref UIElementDrawParams drawParams)
        {
            Rectangle rect = drawParams.Element.Rect;

            rect.X += 1;

            UltraGridRow ultraGridRow = (UltraGridRow)drawParams.Element.GetContext(typeof(UltraGridRow));

            // active row header color
            if (ultraGridRow.IsActiveRow == true)
            {
                drawParams.AppearanceData.BackColor = CommonColorSet.ActiveCellHeaderColor;
            }

            drawParams.DrawBackColor(rect);
            drawParams.DrawBorders(UIElementBorderStyle.Solid, Border3DSide.Top | Border3DSide.Bottom | Border3DSide.Right, rect);

            // draw row number
            drawParams.DrawString(drawParams.Element.Rect, (ultraGridRow.VisibleIndex + 1).ToString(), false, false);

            // draw CRUD image. (DataRow Only)
            Rectangle imageRect = new Rectangle(rect.Left + 3, rect.Top + (ultraGridRow.Height - Properties.Resources.new_16.Height) / 2, Properties.Resources.new_16.Width, Properties.Resources.new_16.Height);

            // DataRowView 얻기
            DataRowView dataRowView = (DataRowView)ultraGridRow.ListObject;
            DataRow     dataRow     = dataRowView.Row;

            switch (dataRow.RowState)
            {
            case DataRowState.Added:
                drawParams.DrawImage(Properties.Resources.new_16, imageRect, false, null);
                break;

            case DataRowState.Modified:
                drawParams.DrawImage(Properties.Resources.edit_16, imageRect, false, null);
                break;

            case DataRowState.Deleted:
                drawParams.DrawImage(Properties.Resources.delete_16, imageRect, false, null);
                break;
            }
        }