Dynamic Webexpander Items and ContentTemplates

4 replies. Last post: January 3, 2014 2:57 PM by Dean Moor
Tags :
Dean MoorMember

I am trying to create a profile viewer (similar to the example with the google maps) with the exception being the data is dynamic. I am hoping to have a list of profiles as WebExpanderItems (showing picture, user name via a header template) and when each one is expanded, the content is shown to the right again using a content template showing dynamic data.

What has been killing me, is loading the headertemplate and content template via the page_load method as nothing shows. If I dont use a template for the header, I can get the username only to show, but expanding the content shows only an empty box.


Any assistance here would be greatly appreciated as I am relatively new to asp.net and very new to the intersoft controls.


Thanks heaps.

Answers

Hello,

Thank you for the reply.

To add WebExpander’s item with HeaderTemplate and ContentTemplate, please try to add the item in “OnPreInitialize” server side event.

I attached the working sample regarding adding item with HeaderTemplate and ContentTemplate.

Please kindly have review on the sample and let know your response.

To get the attached sample, please try to follow this link: http://sdrv.ms/1bCWRIE

Regards,
Hans.

All Replies

Hello,

Thank you for the question regarding WebExpander.

If you don’t mind, could you provide the sample page / code that similar with your current scenario?
So I can help you to investigate further more regarding your scenario.

I apologize for any inconvenience this problem may have caused you.

Regards,
Hans.
Dean MoorMember
foreach (DataRow lcDataRow in lcData.Rows){
  WebExpanderItem lcItem = new WebExpanderItem();
  lcItem.Header = lcDataRow["username"].ToString();
  TemplateBuilder content = new TemplateBuilder();
  ///Snipped out the building of the template.
  lcItem.ContentTemplate = content;
  lcItem.Name = lcDataRow["username"].ToString();
  WebExpander1.Items.Add(lcItem);
}

The above code is very similar to what I am attempting to achieve.

I have snipped out the actual building of the template as this seems irrelevant. It doesn’t matter how I do it, using samples, loadtemplate() etc...

The end result is an empty header and content for each item from the database.

Let me know if you need more specific details and don’t apologise for helping me! I am so very grateful!

Thanks.

Hello,

Thank you for the reply.

To add WebExpander’s item with HeaderTemplate and ContentTemplate, please try to add the item in “OnPreInitialize” server side event.

I attached the working sample regarding adding item with HeaderTemplate and ContentTemplate.

Please kindly have review on the sample and let know your response.

To get the attached sample, please try to follow this link: http://sdrv.ms/1bCWRIE

Regards,
Hans.
Dean MoorMember
Hans,

Thank you so much. I don't know why I didn't think of that, but what ever the reason, you were right on the money. :-)

Thank you for the quick replies, and the support.

Dean.
All times are GMT -5. The time now is 12:43 PM.
Previous Next