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. Image for the cookie policy date

ExcelLikeSelectionFrame - change format

I have a GridControl that can be selected by row only. I want to have the ExcelLikeSelectionFrame show a dotted rectangle around the current row - not that thick rectangle. Is there another property I can set o can I format the excel selection frame differently?

1 Reply

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

Loader.
Live Chat Icon For mobile
Up arrow icon