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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ExcelLikeSelectionFrame - change format

Thread ID:





39655 Jan 14,2006 05:50 AM UTC Jan 16,2006 06:14 AM UTC WinForms 1
Tags: GridControl
Asked On January 14, 2006 05:50 AM UTC

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?

stanleyj [Syncfusion]
Replied On 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\\windows\Grid.Windows\Samples\Quick Start\HighlightCurrentRow.(also available in earlier versions) Best regards, Stanley


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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