View previous topic :: View next topic |
Author |
Message |
mutouaa
Joined: 07 Nov 2007 Posts: 24
|
Posted: Thu Feb 17, 2011 10:34 am Post subject: How to Hide Cell Editor when Clicking |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Feb 17, 2011 10:16 pm Post subject: |
|
|
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 |
|
|
mutouaa
Joined: 07 Nov 2007 Posts: 24
|
Posted: Fri Feb 18, 2011 5:04 am Post subject: |
|
|
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 |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Feb 18, 2011 11:46 pm Post subject: |
|
|
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 |
|
|
|