Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Highlighter Class
Message
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00458827
Message ID:
00459427
Views:
32
Nick,

I don't know. Let's see, if anyone else will support this suggestion. I'm just telling you, that it's a little bit confusing, especially, if somebody doesn't know the specific. I can not remember in my code when I call object.Init() from another object some method (forget about CreateObject/NewObject for a moment). Cetin has something similar in his MultiSelect grid, but I don't like it, so I changed it to be GridInit method :) in my version of his class...

Anyway, as I already said, it's not a big deal and we can perfectly live with it...

>There are only 5 lines of code in Init(), only 2 related to the grid record source so I thought it was not necessary to add another method and another line of code just to call those 2 lines.
>
>>Hi Nick,
>>
>>Ok, I see now (haven't time yet to dig in your class, sorry). Anyway, from the usual point of view (without awareness of GridHiglighter specific), this event sequence seems a little bit weird. May be instead of Init, it should be additional method, like ResetGridRecordSource()? Internally it could call Init(), if it wants, but it would be more meaningful, I think... Anyway, that's not important...
>>
>>>Hi Nadya,
>>>
>>>There is nothing wrong with calling GridHighlighter.Init().
>>>In fact it is in README.DOC:
>>>
>>>"If you want to reset the Grid.Recordsource on the fly in your code you will need also to call GridHighlighter.Init() so it will be aware of the new RecordSource and will reset Dynamic... properties."
>>>
>>>The code in Init() automatically picks up the current host grid.RecordSource and keeps it in cHostAlias property.
>>>
>>>>Hi John,
>>>>
>>>>May be unrelated observation, but it just caught my attention: Why do you call GridHighlither1.Init() from some other methods. AFAIK, you don't have to call Init somewhere, it's called once automatically, then your control is instantiated. If you do it in your code, I'm afraid, you break the event consequences...
>>>>
>>>>>Hi,
>>>>> Sorri, I got another problem here. Any thing go wrong with the code below?
>>>>>The code will be called in my SEARCHFORM.INIT(). It cause INVALID EXPRESSION DYNAMICBACKCOLOR if I launch my SEARCHFORM, I run a report and launch the SEARCH FORM AGAIN!!!
>>>>>
>>>>>Thank you
>>>>>
>>>>>
>>>>>
>>>>>LPARAMETER tcCardType
>>>>>
>>>>>THIS.grdMembers.RECORDSOURCE = ""
>>>>>
>>>>>SELECT Card_No, E_Name, IC_No, DELETED() AS lDeleted;
>>>>>FROM Member NOFILTER ;
>>>>>WHERE LEFT(Card_No, 3) = tcCardType ;
>>>>>INTO CURSOR myMember
>>>>>
>>>>>IF _TALLY > 0
>>>>>	WITH THIS
>>>>>		.ShowList("Card_No")
>>>>>		.grdMembers.RECORDSOURCE = "myMember"
>>>>>	ENDWITH
>>>>>ENDIF
>>>>>
>>>>>WITH THIS
>>>>>	.GRIDHIGHLIGHTER1.Init()
>>>>>	.RefreshGrid()
>>>>>	.grdMembers.SETFOCUS
>>>>>	.txtKeyword.SETFOCUS
>>>>>ENDWITH
>>>>>
>>>>>
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform