Adding run time grid controls in on-hand form field not allowing to export into excel

Hi Team,
I had a requirement to add around 15 fields in on hand inventory form. I had successfully added those using formbuildgridcontrol in the form to avoid the performance issue .But the challenge here is ,when I export the content into excel ,the newly added dynamic fields are not showing in excel.
please advise on this .Do we have any alternate option to show the data during the export?

Hi Team,
Looking for the options to implement on the same.

I’m assuming that the problem is in adding those controls at runtime.

Note that there is no difference in performance if you add the same control at design time or runtime. The result is the same and therefore the behaviour it the same too. Also, what takes time is the database query, not displaying in the form.

Maybe you mean that you want to use grid columns bound to data source fields, rather then using display methods, but that doesn’t require adding controls at runtime.

Thank you Martin for your prompt reply.
Actually the business, maintaining the setup form to add the categories in the on-hand form based on the checkbox selection.Problem here is we don’t know how many categories will be present.for now it’s 10 in future it may increase to More than that.