In GridGroupingControl hovering over a cell should highlight whole raw

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

1 Reply

AK Arun Kumar V Syncfusion Team December 12, 2012 11:45 AM UTC

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.


Loader.
Up arrow icon