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.

In GridGroupingControl hovering over a cell should highlight whole raw

Thread ID:

Created:

Updated:

Platform:

Replies:

106097 Dec 10,2012 08:32 AM Dec 12,2012 06:45 AM Windows Forms 1
loading
Tags: GridControl
Gaukhar Massabayeva
Asked On December 10, 2012 08:32 AM

Hi,
 
In a way I want to reproduce the behaviour of onMouseOver and onMouseOut html behaviour but in gridgroupingcontrol.
 
 

Arun Kumar V [Syncfusion]
Replied On December 12, 2012 06:45 AM

Hi Gaukhar,

 

Thanks for your interest in syncfusion products.

Query:

Highlight rows based on onMouseOver and onMouseOut behavior in gridGrouping control.

Please make use of the following code and let me know if the reported issue had been fixed. If you want to show the color for the cell that has been hovered using mouse, then you can make use of the QueryCellSyleInfo where you can get the row index and column index of the specific point region and this point can be retrieved from the mouse position.

Notes:

Similarly using the rowindex/columnindex gained from the querycellinfo event you can make the desired moved hovered row or column highlighted.

Code snippet:

<code>

void gridGroupingControl1_QueryCellStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs e)

{

GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;

GridTableCellStyleInfo style = e.Style as GridTableCellStyleInfo;

if (style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell

|| style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell)

{

int row, col;

Point pt = new Point(MousePosition.X, MousePosition.Y);

Point pt1 = this.gridGroupingControl1.TableControl.PointToClient(pt);

this.gridGroupingControl1.TableControl.PointToRowCol(pt1, out row, out col);

if (e.TableCellIdentity.ColIndex == col && e.TableCellIdentity.RowIndex == row)

{

e.Style.TextColor = Color.LightBlue;

this.gridGroupingControl1.TableControl.RefreshRange(GridRangeInfo.Cell(row, col));

}

}

}

</code>

Please let me know if you have any other concerns.

 

Regards,

Arun.


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.

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.

;