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

How do I prevent the current cell begin highlighted?

Thread ID:





93950 Apr 13,2010 03:05 PM UTC Apr 14,2010 05:52 PM UTC Silverlight 1
Tags: GridControl
Wayne Bradney
Asked On April 13, 2010 03:05 PM UTC

I have a very simple grid model where I want the cells to be non-editable and non-selectable -- I can't seem to achieve this. I've tried:

cell.IsEditable = false
cell.ReadOnly = true
cell.CellEditTemplate = null

But still, when I click a cell, it gets a black border and the contents of the cell are highlighted (causing the text to also wrap, making half the data scroll outside the visual area of the cell.

How do I prevent this?

Karthik Vishnu R [Syncfusion]
Replied On April 14, 2010 05:52 PM UTC

Hi Wayne,

To disable seletion and also to make cell readonly please use the following code snippet:

this.grid.Model.TableStyle.CellType = "Static";
this.grid.Model.Options.ExcelLikeCurrentCell = false;
this.grid.Model.Options.AllowSelection = Syncfusion.Windows.Controls.Grid.GridSelectionFlags.None;

Also, to avoid text wrapping you can use the following code:

this.grid.Model.ResizeColumnsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);

Above code sizes column based on cell content.

We have prepared a sample illustrating above features. You can download it from the following location:


Let us know if you need more details.



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