Please refer to this post first made by another person it that solution worked except after post back the template is gone, my template display an image button only when a criteria has been met then in that row an image button is displayed they can click on, in my case they click on it disappears. How do I get it to stay after a post back is performed?
Reference Link: http://www.infragistics.com/community/forums/t/63560.aspx
Hello Sri Denduluri,
Thank you for posting in our forums!
If you are creating the templates dynamically, you need to set the cell's Template property on each postback.
If you need further assistance with this, please let me know and I will be glad to help.
Hi Michael,
yes I know I have to re-set the cells template after postback but which event do I use to do this, and I don't have to make repeated database calls to do this do I? Cuz it uses value from a table to determine which cell is assign the template or not?
hi Michael, I have another problem I got the template to load, by storing the data table in memory (session), and it loads fine after postback, now have another problem. The template contains control, a usercontrol is one of the many controls it contains (see below 'UserControl'), now the problem is this, when rowInitialize, and or when Page_Load occurs, and it calls the Usercontrols Page_Load event, the controls (see below 'lblHeader', 'grdLabResults') are null, why is this shouldn't this be automatic, when the controls have been created as I have done below in the Usercontrol page file, also see my code-behind file as well.
UserControl (LabResults)
Thank you for the update. So far I have been unable to reproduce the behavior you describe. How are you creating the user controls in your main page? Can you please attach an isolated sample that reproduces the issue?
hi mike, I create a demo for u, when u run it I hard coded a break point when u hover over the control u wil see that it is null. I need tyur email address so I can send directly to you?
Hello Sri,
I have made a private case with the ID CAS-179783-L9G7F5 for this matter. You will receive an email with a link to where you can update the case and attach your sample.
Sri,
The objects defined in the markup don't have instances created when creating the UserControl with new. To address this, use Page.LoadControl to instantiate the UserControl to address this. The same issue is addressed in the following question on stackoverflow:
http://stackoverflow.com/questions/2275625/asp-net-custom-user-control-to-add-dynamically
Let me know if you have any questions with this matter.