Bug reports Found a bug? Post it here please.
Version 6.x > Bug reports > ListView Controls disappear View modes: 
User avatar
Member
Member
jukkausb-mail - 12/21/2011 7:07:24 AM
   
ListView Controls disappear
Hello!
I created a user control that derives from CMSAbstractWebPart.
It contains several ListView and FormView controls in its controls tree.
Any time I do postback, these controls disappear! It seems like DataBinding does not work and these controls have nothing to render. In some scenarios I managed to avoid this by calling <ControlName>.DataBind() method. But I would not want to do this every time.

If I use my control inside regular web application or web site, it works correctly as I expect.

Can I fix it some how in Kentico ???

User avatar
Member
Member
kentico_michal - 12/21/2011 9:01:55 AM
   
RE:ListView Controls disappear
Hello,

Web parts inherited from the CMSAbstractWebPart class has a slighly different page life cycle as a standard .NET UserControl. So, if your control contains only standard ASP.NET controls and it works correctly outside Kentico CMS, it is not necessary to create a new CMSAbstractWebPart web part. You can insert the custom user control (ASCX file) onto the page using the User control web part. All you need to specify is the User control virtual path property that specifies the virtual path to the .ascx file of the user control that will be placed on the page. For example: ~/CMSGlobalFiles/control.ascx

Best regards,
Michal Legen

User avatar
Member
Member
jukkausb-mail - 12/21/2011 9:49:57 AM
   
RE:ListView Controls disappear
Thank you very much.
I did exactly as you said.
And now everything works fine.