Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

MenuList ItemDataBound

Vote:
 

Hi,

I want to listen to the ItemDataBound event to be able to calculate first and last item that is bound to a MenuList. MenuList control does not seem to support this event?

Mabye this can be accomplished in some other way?

Regards

#25363
Oct 22, 2008 15:23
Vote:
 

No, the EPiServer controls are missing these features.

One way to get around this issue is to create a UserControl that you place in the ItemTemplate (or similar) and place your code in the OnDataBinding method of that control. Just make sure that you call base.OnDataBinding() the first thing you do in that method.

Cheers
Henrik

#25375
Oct 23, 2008 0:02
Vote:
 

One other way of doing it is to make your own menuList, that inherit from episervers menulist. Take a look with reflector and check CreateChildControls()

 

#25442
Oct 25, 2008 23:26
Vote:
 

Great ideas,

Writing my own custom menulist would be great but unfortunately there's no time for that in this project. Frown

I did solve it in a similar way as Henrik suggested.

Thanks

#25446
Edited, Oct 26, 2008 18:26
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.