Home Forums WinForms controls Xceed Grid for WinForms different cell forecolors in the selected row Reply To: different cell forecolors in the selected row

User (Old forums)
Member
Post count: 23064

Hi,

this should do:

        public Form1()
        {
            Xceed.Grid.Licenser.LicenseKey = “GRD38-…..-…..-RNAA”;
            InitializeComponent();
            gridControl1.SelectionMode = SelectionMode.None;
            foreach (Column column in gridControl1.Columns)
            {
                column.CellEditorManager.SettingControlAppearance += new Xceed.Grid.Editors.CellEditorEventHandler(CellEditorManager_SettingControlAppearance);
            }
        }

        void CellEditorManager_SettingControlAppearance(object sender, Xceed.Grid.Editors.CellEditorEventArgs e)
        {
            e.Control.ForeColor = Color.Blue;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // gridControl1.SingleClickEdit = true;   // to make the grid cells editable on a single click
        }

Imported from legacy forums. Posted by Ghislain (had 2085 views)