I am using the devexpress TreeList control. In Treelist I have a situation where one of my column is read only. This column may have some text values added when something happens in another cell. I have restricted user entry in the cell by setting a property like this
treeList1.Columns["col3"].OptionsColumn.ReadOnly = true;
Now I want to remove text value from some of the cells and since it is read only the delete buttons does not work. Can you suggest the event/method and the code which will allow user to delete the text? Any help would be much appreciated.
Edited solution :
You should know that when the cursor is in the cell (in edit mode), and you press a button, it's not the
TreeList
who send theKeyDown
event, but theRepositoryItemButtonEdit
. So, you should handle the event also for theRepositoryItemButtonEdit
.To not duplicate code, I've wrote one handler '
onKeyDown
', in whitch I verify who is the sender.And here is a code exemple showing you how to handle the
KeyDown
event for bothtreeList
andrepositoryButtonEdit
, and set the cell value tonull
: