Beispiel #1
0
        private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridDataCellElement cell = e.CellElement as GridDataCellElement;

            if (cell != null)
            {
                if (cell.ContainsErrors)
                {
                    cell.DrawBorder     = true;
                    cell.BorderBoxStyle = BorderBoxStyle.FourBorders;

                    cell.BorderBottomColor       = cell.BorderTopColor = cell.BorderRightShadowColor = cell.BorderLeftShadowColor = Color.Transparent;
                    cell.BorderBottomShadowColor = cell.BorderTopShadowColor = cell.BorderRightColor = cell.BorderLeftColor = Color.Red;
                    cell.BorderBottomWidth       = cell.BorderTopWidth = cell.BorderRightWidth = cell.BorderLeftWidth = 1;

                    cell.BorderDrawMode = BorderDrawModes.HorizontalOverVertical;
                    cell.ZIndex         = 2;
                }
                else
                {
                    cell.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
                    cell.ResetValue(LightVisualElement.BorderBoxStyleProperty, ValueResetFlags.Local);
                    cell.ResetValue(LightVisualElement.BorderDrawModeProperty, ValueResetFlags.Local);
                    cell.ResetValue(LightVisualElement.ZIndexProperty, ValueResetFlags.Local);
                }
            }
        }
Beispiel #2
0
        private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridDataCellElement dataCell = e.CellElement as GridDataCellElement;

            if (dataCell.ColumnInfo.Name == "Name")
            {
                GridViewDataRowInfo dataRow = dataCell.RowInfo as GridViewDataRowInfo;
                dataCell.ImageAlignment = ContentAlignment.MiddleLeft;

                string valueType = Convert.ToString(dataRow.Cells["Type"].Value).ToUpperInvariant();

                if (valueType.Contains("FILE") || valueType.Contains("DOCUMENT"))
                {
                    dataCell.Image = this.imageList1.Images[2];
                }
                else if (dataRow.IsExpanded)
                {
                    dataCell.Image = this.imageList1.Images[1];
                }
                else
                {
                    dataCell.Image = this.imageList1.Images[0];
                }

                dataCell.TextImageRelation = TextImageRelation.ImageBeforeText;
            }
            else
            {
                dataCell.ResetValue(LightVisualElement.ImageProperty, Telerik.WinControls.ValueResetFlags.Local);
                dataCell.ResetValue(LightVisualElement.ImageAlignmentProperty, Telerik.WinControls.ValueResetFlags.Local);
                dataCell.ResetValue(LightVisualElement.TextImageRelationProperty, Telerik.WinControls.ValueResetFlags.Local);
                dataCell.ResetValue(LightVisualElement.ImageLayoutProperty, Telerik.WinControls.ValueResetFlags.Local);
            }
        }
Beispiel #3
0
        private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridDataCellElement cell = e.CellElement as GridDataCellElement;

            if (cell != null)
            {
                if (cell.ColumnInfo.Name == "Notes")
                {
                    cell.Font    = italicFont;
                    cell.Padding = new Padding(4);
                }
                else
                {
                    cell.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local);
                    cell.ResetValue(LightVisualElement.PaddingProperty, ValueResetFlags.Local);
                }
            }
        }