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.
Syncfusion Feedback

Allow selection, disable edit

Thread ID:

Created:

Updated:

Platform:

Replies:

103715 May 27,2012 10:14 AM UTC May 29,2012 10:25 AM UTC Windows Forms 4
loading
Tags: Grouping
ian bradley
Asked On May 27, 2012 10:14 AM UTC

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.



ian bradley
Replied On 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.






ian bradley
Replied On 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?

ian bradley
Replied On 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.




Asarudheen S [Syncfusion]
Replied On 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.

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.

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

;