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

How do I prevent the current cell begin highlighted?

Thread ID:

Created:

Updated:

Platform:

Replies:

93950 Apr 13,2010 11:05 AM Apr 14,2010 01:52 PM Silverlight 1
loading
Tags: GridControl
Wayne Bradney
Asked On April 13, 2010 11:05 AM

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 01:52 PM

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:

http://www.syncfusion.com/uploads/redirect.aspx?file=WpfApplication7_ca414521.zip&team=development

Let us know if you need more details.

Regards,
Karthik

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.

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.

;