Hi, I have (in D2010) a TDrawGrid on my form. Im handling my OnDrawCell, OnSetEditText, OnSetEditText etc alls gfine there.
If however in the specific situation that you go in a cell that has some text, highlight the text in its entirity, then type some character to replace. Now the OnSetEditText event fires twice in a row from one keypress, firstly with a blank string, then again with a string containing the character you type. Is this correct or a bug? I would have expected to just get the event fired once with the string containing my single character typed.
I am using OnSetEdit text to set other class properties which does stuff like validation, so when the above situation causes my other code to consider momentarily my class properties to be invalid, before imediately being set back to valid again on the 2nd fire, its still having undesriable consequences though and i want to stop that 1st event firing, or get the bets workaround I can.
Now whilst on the subject of grids, may I appeal to you folks for an helpful tips in the folling things. I am fairly new to deplhi from c# (I'm going the other way!) but Im finding the docs to be pretty thin on the ground, and am getting surprisingly limited results googling for things, so your help is really appreciated.
1) Custom Inplace Editors for TDrawGrid - any tips or good links appreciated! 2) For custome inplace editors, am i better off with TDrawGrid or descending my own control from TCustomGrid and going from there? 3) TCustomGrid. I am getting nowhere here... If I create a new component and descend from TCustomGrid I just get an 'abstract error' when i place it my form. Therefore further experimentation is very much canclled - an advice on just even getting started with TCustomGrid appreciated!
My plan is first to get combo boxes (in virtual mode) working as cell editors. Thats a standard VCL control. Afterwards I plan to create my own control based around a virtual combobox but with a search thing at the top to filter the list down (a bit like in the Delphi IDE Tool pallette), and use this component as inlace editor if possible. Im a fair way off that right now! Thanks all
Edit: Remy - Here are my two call stacks from beak point in OnSetEditText. Left is first fire with the empty string, right is 2nd fire with correct string value. The 5 truncated lines in the middle are all references to comctl32.dll in both. Ty.