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
close icon

Allow selection, disable edit

I'm looking for something like the StaticCell type from the GridControl. So I want to be able to select cells, but I do not want the user to be able to select text in a cell. When they click on a cell it should not enter edit mode.

I can disable edits by making the GridColumnDescription readonly, but you can still click in a cell and it allows you to select text.



4 Replies

IB ian bradley May 27, 2012 10:24 AM UTC

Interesting, I managed to do it but have a follow on question: So I did this:
private void _gridGroupingControl_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
    e.Style.CellType = "Static";
}

Which isn't ideal. It was pure chance that I thought the StyleInfos might still exist, so how do I define and associate them? How are they different to the GridColumnDescriptors? They seem to have similar stuff in them.







IB ian bradley May 27, 2012 10:27 AM UTC

Sorry, last spam, still need answer. Setting it to static does what I want for the cell, but also disables any other formatting I applied via the table style and so on. Which I guess is logical. So what is the bit of the style that actually makes the text static?


IB ian bradley May 27, 2012 11:27 AM UTC

Ok, solved that too. It seems the GridColumnDescriptors appearance  has cell infos for lots of different types of cell, so

desc3.Appearance.RecordFieldCell.CellType = "Static";
makes my column static for record field cells which are the ones I want.





AS Asarudheen S Syncfusion Team May 29, 2012 10:25 AM UTC

Hi Ian,

Thank you for your interest in Syncfusion products.

We are glad to hear that your issue has been resolved. Please let us know if you need any further assistance.

Thank you for using Syncfusion products.

Regards,
Asarudheen.

Loader.
Live Chat Icon For mobile
Up arrow icon