ST
stanleyj
Syncfusion Team
January 16, 2006 06:14 AM UTC
Hi Va,
The easier way that can be done is to draw the borders in the PrepareViewStyleInfo handler.
private void gridControl1_PrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.GridPrepareViewStyleInfoEventArgs e)
{
GridControlBase grid = gridControl1;
GridCurrentCell cc = grid.CurrentCell;
if (e.RowIndex > grid.Model.Rows.HeaderCount && e.ColIndex > grid.Model.Cols.HeaderCount
&& cc.HasCurrentCellAt(e.RowIndex))
{
e.Style.Borders.Top = new GridBorder(GridBorderStyle.Dashed, Color.Black, GridBorderWeight.Medium);
e.Style.Borders.Bottom = new GridBorder(GridBorderStyle.Dashed, Color.Black, GridBorderWeight.Thick);
}
}
Also turn RefreshCurrentCellBehavior to RefreshRow.
this.gridControl1.RefreshCurrentCellBehavior = GridRefreshCurrentCellBehavior.RefreshRow;
this.gridControl1.ListBoxSelectionMode = SelectionMode.One;
For more details refer sample in \Syncfusion\Essential Studio\4.1.0.10\windows\Grid.Windows\Samples\Quick Start\HighlightCurrentRow.(also available in earlier versions)
Best regards,
Stanley