Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
505
Selected row coloring with mouse over
posted

I use MouseMove event to change the color of row when mouse hovers on rows.  I also implemented multiple row selection.  The selected multi rows display in a different color by default (I did not do any change). The problem I am having is the color of all the multi selected rows has changed as expected, except the row where the mouse stops.  How do I make this particular row to change to the same color as all other selected rows. 

 Also I would like to know how do I customize the color and look of the selected rows.

The following the how I implemented to have row changing color when mouse hovers over.

        private void ultraGrid1_MouseMove( object sender, MouseEventArgs e )
        {
            UIElement el = this.ultraGrid1.DisplayLayout.UIElement.ElementFromPoint( new Point( e.X, e.Y ) );
            if( el != null )
            {
                UltraGridCell c = ( UltraGridCell ) el.GetContext( typeof( UltraGridCell ) );
                if( c != null )
                {
                    if( c.Row.Cells[ "Type" ].Text == "RED" )
                    {
                        this.ultraGrid1.DisplayLayout.Override.HotTrackRowCellAppearance.BackColor = ColorRedHot;
                        this.ultraGrid1.DisplayLayout.Override.HotTrackRowCellAppearance.ForeColor = Color.White;
                    }
                    else
                    {
                        this.ultraGrid1.DisplayLayout.Override.HotTrackRowCellAppearance.BackColor = ColorBlueHot;
                        this.ultraGrid1.DisplayLayout.Override.HotTrackRowCellAppearance.ForeColor = Color.White;
                    }
                }
            }
        }

  • 469350
    Offline posted

    I'm not sure what you are asking.

    To change the selected appearance of a row, you would use the SelectedRowAppearance. Does that answer your question?