• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

How to catch Grid Row which is inserted Programatically


Legendary Poster
Hi List/Forum,

I have to make some custom development on P12130 Beginning Balance Adjustment which has only one Form which is a HeaderlessDetail Form.
I have to default or fill some custom Grid Column and disable the row in some circumtances.
OK, it seems easy to do in Write Grid Line-Before or in Write Grid Line-After event BUT this Form has a very complicated logic with a lot of ER on a bunch of event of a bunch of hidden or visible control, column, etc., including InsertGridBufferRow calls at several places.
My problem is that InsertGridBufferRow does not trigger the Write Grid Line-Before and Write Grid Line-After events.

OK, I can place my logic behind a push button with a flag that indicates wether work with GC or GB values and Press this button in write Grid Line-After event and before ALL InsertGridBufferRow calls.
I really hate the second part of this solution AND further I have to duplicate all InsertGridBufferRow calls based upon my Disable/Enable logic with Protected Yes or No parameter (namly <Currently Selected Row> literal in DisableGrid calls won't point to the inserted row).

Have anybody any hint, idea how to catch the rows in this situation or any better, sophisticated solution for this problem?

Any input, idea, hint will be greatly appreciated!
Thanks in advance.

Platform this time: XE SP15.1 on NTs and SQL

PS1: I really hope, was able to de[censored] my problem enough clear. If still not then please, ask me for further clarifications.
PS2: FYI This P12130 APPL is a really strange one with a tricky logic on LastGridRecordHasBeenRead event while Pag-at-a-Time processing is enabled ;-) and duplicated filtering on the same columns with the same filtering logic, once with FC filter fields, once programaticaly for the same columns with the same criteria in GridRecordIsFetched event usin SuppressGridLine calls, and many other...

B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)


Legendary Poster
Hi Everybody,

I missed the type of the only Form in P12130 application in my original post (Thanks to Adrian Chimirel, who notified me about it).
The type of that Form is Header Detail and not Headerless Detail as I stated previously.
If I was able to de[censored] my issue enough clear then you will surely know that this difference is really irrelevant from the eye-point of my issue.


B7332 SP11, ESU 4116422, Intel NT4, SQL 7 SP1
(working with B7321, B7331, XE too)

Christian Audet

Staff member

I got the same situation, and I'm sorry to tel that I did not find any better solution than yours. I was force to play around with the code before the Insert Grid Row Buffer and also in the Write Grid Line Before.

If you ever find a better solution then I want to hear about it.

Thank, have a good day !


Implementing B7333 (Xe) SP14.1, SQL
(Support B732, B7331 and B7332)