But since I just got asked again about that, I decided to test myself why despite my sample, they are still
asking that. And so I created a new form, created a cursor on its load, created a fresh grid with 2 columns, and dropped that class inside a column. Then I made the CurrentControl of that column the class (ssdropcalc), set its Sparse property to .F. and ensure that the column's ControlSource is my target field. Then I run the form and to my surprise, hey my users of that class really do have some problems in making it run inside the grid because what happens is I cannot see the initial values of those cells/records plus when you entered an amount on that class, all the cells of that column will have the same values. Man.... what have I done last time to make it work? LOL!
And if I now encounter that unusual behavior, how much more are the other users of that class who are just beginning to try understanding how it works? Anyway, I found out the reason so I decided to create this blog to serve as a guide in making it work (properly) inside a Grid. You see, I was cramming to finish the demo forms last time so I can upload it on codeplex and can concentrate back on my real jobs in our Company that when I finish a form, I move on outright to another. And in my rush, I failed to mention a vital step for it to work properly inside a grid.
The Missing Link
This is needed to be done only on a grid. The missing step which I failed to emphasize is that you need to drill down to its Calcbox Object and ensure that its ControlSource is the same as that of the Column's ControlSource. So if the column where ssDropCalc is has a ControlSource of junk.cost, then CalcBox of that class should also have a ControlSource of junk.cost. That is the only missing link for it to work properly on a grid. Cheers!
No comments:
Post a Comment