Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Disable a CellEditor

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Fri Sep 30, 2005 6:53 am    Post subject: Disable a CellEditor Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Sep 30, 2005 10:40 am    Post subject: Reply with quote

Just set e.CellData.Editor to null to disable editing for the cell.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
flc.net



Joined: 21 Jun 2005
Posts: 89
Location: Switzerland

PostPosted: Fri Oct 07, 2005 6:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Oct 07, 2005 8:43 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group