View previous topic :: View next topic |
Author |
Message |
flc.net
Joined: 21 Jun 2005 Posts: 89 Location: Switzerland
|
Posted: Fri Sep 30, 2005 6:53 am Post subject: Disable a CellEditor |
|
|
Dear Support
I tryed to set the Enabled Property of an Editor in the GetCellData Event like this:
Code: |
private void virtualTree1_GetCellData(...)
{
RowBinding binding = virtualTree1.GetRowBinding(e.Row);
binding.GetCellData(e.Row, e.Column, e.CellData);
if(e.Column == colXY)
{
if(e.CellData.Editor != null)
e.CellData.Editor.GetControl().Enabled = GetEnabledState();
}
}
|
But this Code doesn't work. What I make wrong?
Another question:
It's possible to instruct a Cell to not go in the "Edit" mode?
Thanks
Giuseppe |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Sep 30, 2005 10:40 am Post subject: |
|
|
Just set e.CellData.Editor to null to disable editing for the cell. _________________ Infralution Support |
|
Back to top |
|
|
flc.net
Joined: 21 Jun 2005 Posts: 89 Location: Switzerland
|
Posted: Fri Oct 07, 2005 6:44 am Post subject: |
|
|
Hi
It's also possible to set the the Control to Enabled=false? For our Prefix Column that shows alway a CheckBox, setting the Editor to null is not the best way.
Thanks
Giuseppe |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Oct 07, 2005 8:43 am Post subject: |
|
|
You can add a handler to the CellEditor.Initialize event which will be called each time an editor control is assigned to a CellWidget - the problem is that this event wasn't intended for this type of scenario and so doesn't give you the information about about which CellWidget it is being created for.
You could create your own CellWidget (see the section in help on using Widgets) and override the CreateEditorControl method to set EditorControl.Enabled = false in certain conditions. _________________ Infralution Support |
|
Back to top |
|
|
|