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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Howto:? change backcolor in RowStyle of a DataBoundGrid

Thread ID:

Created:

Updated:

Platform:

Replies:

6291 Aug 7,2003 01:56 PM UTC Aug 7,2003 03:00 PM UTC WinForms 1
loading
Tags: GridControl
Peter
Asked On August 7, 2003 01:56 PM UTC

I need the row which the mouse is currently over to be highlighted, CellMouseHoverEnter & Leave events are working but dataBoundGrid1.Model.RowStyles[e.RowIndex].BackColor = Color.AliceBlue; does not do anything to change the backcolor of the row. Is there another way to do this?

Administrator [Syncfusion]
Replied On August 7, 2003 03:00 PM UTC

In a GridDataBoundGrid, you cannot set RowStyles as none are saved in this grid. One way to do this would be to track a currentmouserow variable which you could set in the events you are using now. When you change rows, then call grid.RefreshRange to force the grid to repaint the 2 adjacent rows, the new row and the old row. In PrepareViewStyleInfo, check e.RowIndex to see if it is the courrentMouseRow, and if it is, then set the e.Style.BackColor to your color. In this way, you will color the currentmouse row.

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

;