Is there a way to get the combo's row count without it calling InitializeRow?
Thanks,~Kelly
Hi Kelly,
Probably not. The combo fires InitializeRow when the rows are created. My guess is that this happens lazily, so it will normally occur the first time you drop it down or try to reference a row in code. Calling the count has to access the rows collection, which causes the rows to get created.
Why do you care if InitializeRow fires or not?
I do not want it to be called multiple times so that my conditional appearance code does not occur too many times.
InitializeRow is called quite often. It's called when the cell is first created and any time a value in a row changes. So it's really not an event that you want to put performance-intensive code into.
If you know the values in the cell are not going to change and you only want to apply your appearances once, then you might want to check e.ReInitialize and if it's true, bail out. That way you never process the same row twice.
Also, if you want to make your InitializeRow code as efficient as possible, you should take a look at the WinGrid Performance Guide. There are several tips in there about how to use InitializeRow most efficiently.
Thanks Mike, I will look into your suggestions!~Kelly