H
HmFireBall
Hi,
I want to display a dynamic menu using a custom control extending Repeater.
I need a SelectedItemTemplate a bit like in DataList so that I can
highlite the selected menu item.
Basically, it would look like :
..aspx :
<myns:Repeater runat="server" id="MyRepeater">
<ItemTemplate>
<!-- render a selectable menu item here -->
</ItemTemplate>
<SelectedItemTemplate>
<!-- render the selected menu item here -->
</SelectedItemTemplate>
</myns:Repeater>
..aspx.vb :
MyRepeater.DataSource = MyTable
MyRepeater.DataBind()
MyRepeater.SelectedIndex = MyRowIndex
I can't find any tutorial that explain how to add such a custom template
to Repeater. I think that most of the work would be done if I could
define SelectedItemTemplate extending ItemTemplate, and add a switch
somewhere to tell the control to render the selected RepeaterItem using
SelectedItemTemplate and not ItemTemplate. But I need some help there
Thank you if you can help me.
Henri
I want to display a dynamic menu using a custom control extending Repeater.
I need a SelectedItemTemplate a bit like in DataList so that I can
highlite the selected menu item.
Basically, it would look like :
..aspx :
<myns:Repeater runat="server" id="MyRepeater">
<ItemTemplate>
<!-- render a selectable menu item here -->
</ItemTemplate>
<SelectedItemTemplate>
<!-- render the selected menu item here -->
</SelectedItemTemplate>
</myns:Repeater>
..aspx.vb :
MyRepeater.DataSource = MyTable
MyRepeater.DataBind()
MyRepeater.SelectedIndex = MyRowIndex
I can't find any tutorial that explain how to add such a custom template
to Repeater. I think that most of the work would be done if I could
define SelectedItemTemplate extending ItemTemplate, and add a switch
somewhere to tell the control to render the selected RepeaterItem using
SelectedItemTemplate and not ItemTemplate. But I need some help there
Thank you if you can help me.
Henri