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 

How to Hide Cell Editor when Clicking

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



Joined: 07 Nov 2007
Posts: 24

PostPosted: Thu Feb 17, 2011 10:34 am    Post subject: How to Hide Cell Editor when Clicking Reply with quote

Hello Infralution Team,

As I am now using infralution tree GetCellData event handler to decide a cell editor. Now I have a huge amount of data, it is time consuming if the cell editable check is done in GetCellData event handler.
so I hope to have a method to decide whether to show editor control when user clicks the cell (editor control display mode is "OnEdit"). Is it possible that the CellEditor is not shown when cell is clicked even if it is already defined?

Thank you in advance!
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Feb 17, 2011 10:16 pm    Post subject: Reply with quote

GetCellData is only called for cells which are visible - so the size of your datasource should not affect the performance (once you reach the point where your data fills the available screen space).
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
mutouaa



Joined: 07 Nov 2007
Posts: 24

PostPosted: Fri Feb 18, 2011 5:04 am    Post subject: Reply with quote

thank you for the reply.
I know GetCellData is only invoked when cell is shown on screen. but my problem is the data amount is very huge and to check all the cell editable is so time consuming. I cannot get all the check results from database. To check editable for each cell in GetCellData is also not a good idea. So I hope not to have any check result when the tree displays and check editable only when user clicks a cell. Is there a way to implement this?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Feb 18, 2011 11:46 pm    Post subject: Reply with quote

You could derive a new class from VirtualTree and override the StartEdit method - then only call the base method if you want the edit to proceed. Note that this will only be called in the first place if you have set a CellEditor for the cell. The only problem I can see with this approach is that it may muck up the keyboard (tab key) traversal - since Virtual Tree will still think that cell is editable - even if you don't start an edit on it.

I suspect you must be doing something unusual if determining the editability in the GetCellData event is causing performance problems. We have plenty examples of code that do this with no performance issues. The cost of determining the CellEditor to use should not be any more than the cost of determining the text to display.
_________________
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