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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Selecting a single cell

Thread ID:





16672 Jul 21,2004 05:25 PM UTC Jul 21,2004 06:27 PM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On July 21, 2004 05:25 PM UTC

How do you select a single cell? Specifically, in the PrepareViewStyleInfo, I''ve got something like this: if(this.Selections.Ranges.AnyRangeContains(GridRangeInfo.Cell(e.RowIndex, e.ColIndex))) { if (this.Focused) { e.Style.BackColor = selectedRowWithFocusColor_; } else { e.Style.BackColor = selectedRowWithoutFocusColor_; } } I can select multiple cells by using Shift or Ctrl, or selecting rows, columns or table, and the cells get colored properly, but I can''t select and individual cell. The cells have a CellType of static. Thanks. Pete

Administrator [Syncfusion]
Replied On July 21, 2004 06:18 PM UTC

The currentcell is not considered as being selected unless your set the ExcelLikeCurrentCellSelection property. Setting this property will also change how the currentcell frame is drawn so you may not want to do it. In that case in addition to checking whether e.RowIndex and e.ColIndex point to a selected cell in PrepareViewStyleInfo, you can also test if it is the CurrentCell by checking if ||e.RowIndex == grid.CurrentCell.RowIndex && e.ColIndex == grid.CurrentCell.ColIndex.

Administrator [Syncfusion]
Replied On July 21, 2004 06:27 PM UTC

Excellent. Thanks Clay.


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

Live Chat Icon For mobile
Live Chat Icon