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

Non-highlighted selected cell in R/O short of manual Paint

Thread ID:

Created:

Updated:

Platform:

Replies:

5635 Jul 11,2003 08:36 AM UTC Jul 11,2003 10:25 AM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 11, 2003 08:36 AM UTC

I am using some GridDataBoundGrid control in read only mode. I should much prefer the current cell to be just the color of selection, without standing out. Is there a proper style to grant such a wish? Grateful in advance, Alexey

Administrator [Syncfusion]
Replied On July 11, 2003 10:25 AM UTC

There is no property setting to manage this, but you can do it by handling the CellDrawn event and filling the cell with the alphablend selection color if it is an the current cell. private void gridDataBoundGrid1_CellDrawn(object sender, GridDrawCellEventArgs e) { GridDataBoundGrid grid = sender as GridDataBoundGrid; if(grid != null) { GridCurrentCell cc = grid.CurrentCell; if(e.ColIndex == cc.ColIndex && e.RowIndex == cc.RowIndex && grid.Selections.Ranges.AnyRangeContains(GridRangeInfo.Cell(e.RowIndex, e.ColIndex)) && !cc.IsEditing) { SolidBrush br = new SolidBrush(grid.AlphaBlendSelectionColor); e.Graphics.FillRectangle(br, e.Bounds); br.Dispose(); } } }

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.

Please sign in to access our forum

or the page will be automatically redirected to 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

;