We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Outlining the row which the mouse is over

Thread ID:

Created:

Updated:

Platform:

Replies:

7498 Sep 27,2003 02:49 AM UTC Sep 29,2003 05:40 PM UTC WinForms 1
loading
Tags: GridControl
Peter
Asked On September 27, 2003 02:49 AM UTC

I am using the CellMouseHoverEnter event to keep track of the mouse and the PrepareVeiwStyleInfo event to draw the border. One problem the event does not repaint the cells. It will only do that if it is the current row. Here is the code im using inside the PrepareVeiwStyleInfo event if (this._currentRowMouseOver == e.RowIndex) { e.Style.Borders.Top = new GridBorder(GridBorderStyle.Solid, ColorScheme.Rows.MouseOverBorder); e.Style.Borders.Bottom = new GridBorder(GridBorderStyle.Solid, ColorScheme.Rows.MouseOverBorder); if (e.ColIndex == 1) e.Style.Borders.Left = new GridBorder(GridBorderStyle.Solid, ColorScheme.Rows.MouseOverBorder); } P.S. How can i draw a border on the right edge and is there a better way to do this? TIA, Peter

Administrator [Syncfusion]
Replied On September 29, 2003 05:40 PM UTC

> I am using the CellMouseHoverEnter event to keep track of the mouse and the PrepareVeiwStyleInfo event to draw the border. One problem the event does not repaint the cells. It will only do that if it is the current row. > > Here is the code im using inside the PrepareVeiwStyleInfo event > > if (this._currentRowMouseOver == e.RowIndex) > { > e.Style.Borders.Top = new GridBorder(GridBorderStyle.Solid, ColorScheme.Rows.MouseOverBorder); > e.Style.Borders.Bottom = new GridBorder(GridBorderStyle.Solid, ColorScheme.Rows.MouseOverBorder); > > if (e.ColIndex == 1) > e.Style.Borders.Left = new GridBorder(GridBorderStyle.Solid, ColorScheme.Rows.MouseOverBorder); > } > > P.S. How can i draw a border on the right edge and is there a better way to do this? > > TIA, > > Peter In CellMouseHoverEnter you could save the RowIndex that the mouse is hovering over in a variable and only when rowIndex for the event is different from the previously saved then you call InvalidateRange or RefreshRange so that the row gets repainted. To draw the border on the right edge that should work: if (e.ColIndex == ColCount) e.Style.Borders.Right = new GridBorder(GridBorderStyle.Solid, ColorScheme.Rows.MouseOverBorder); You should also handle the Control.MouseLeave event. The way you implment this behavior with MouseHoverXXX and PrepareViewStyleInfo is reasonable. Stefan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;