David Compton
1/21/2007 11:11:00 PM
I have a user control that contains a grid that fires a selectedindexchanged
event. My problem is that the event does not fire when the user control
is cached. I have read a lot on the web to try to resolve this issue - but
with no success. I am reloading my cached user control in the Page_Load
event as follows (using Delphi.Net):
aUserControl:= nil;
aControl:= LoadControl('PortfolioInvestmentStrategyUserControl.ascx');
InvestmentStrategiesPlaceHolder.Controls.Add(aControl);
if aControl is TPortfolioInvestmentStrategyUserControl then
aUserControl:= aControl as TPortfolioInvestmentStrategyUserControl
else
if (aControl is PartialCachingControl) and (PartialCachingControl(aControl).CachedControl
<> nil) then
aUserControl:= PartialCachingControl(aControl).CachedControl as TPortfolioInvestmentStrategyUserControl;
if aUserControl <> nil then
begin
aUserControl.ID := 'InvestmentStrategy' + I.ToString;
aUserControl.InvestmentStrategy := Strategies[I] as InvestmentStrategy;
end;
Regards,
David Compton
mailto:david.w.compton@gmail.com