Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > SelectedItemTemplate does not show in datalist

Reply
Thread Tools

SelectedItemTemplate does not show in datalist

 
 
Raymond Du
Guest
Posts: n/a
 
      12-05-2004
Hi,

I have the following templates inside a datalist:

<SelectedItemTemplate>
&nbsp;<%# Container.DataItem("Title") %>
</SelectedItemTemplate>
<ItemTemplate>
&nbsp;<asp:LinkButton id="lnkAction" runat="server" cssClass="OtherTabs"><%#
Container.DataItem("Title") %></asp:LinkButton>
</ItemTemplate>


The Titles show up regular items. But when an item is selected, Title
disappears, I only see a blank space. I am sure Title has value because it
shows when the item is not selected.

Any Ideas?

TIA


 
Reply With Quote
 
 
 
 
Johann MacDonagh
Guest
Posts: n/a
 
      12-05-2004
Chances are, it has to do with the way you are binding or the way you are
setting the SelectedIndex. Could you post some more code (specifically, the
entire DataList declaration, as well as the code-behind methods that bind
your data and set the SelectedIndex value. From what you've posted, it looks
as if your code will work, therefore, it must be something in your code
which is causing the problem.

Thanks,
Johann MacDonagh

"Raymond Du" <(E-Mail Removed)> wrote in message
news:eyRw%(E-Mail Removed)...
> Hi,
>
> I have the following templates inside a datalist:
>
> <SelectedItemTemplate>
> &nbsp;<%# Container.DataItem("Title") %>
> </SelectedItemTemplate>
> <ItemTemplate>
> &nbsp;<asp:LinkButton id="lnkAction" runat="server"
> cssClass="OtherTabs"><%#
> Container.DataItem("Title") %></asp:LinkButton>
> </ItemTemplate>
>
>
> The Titles show up regular items. But when an item is selected, Title
> disappears, I only see a blank space. I am sure Title has value because it
> shows when the item is not selected.
>
> Any Ideas?
>
> TIA
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datalist SelectedItemTemplate problem Kim Søvsø Pedersen ASP .Net Web Controls 2 10-19-2005 08:34 PM
<selectedItemTemplate> Steve Klett ASP .Net Datagrid Control 2 11-19-2003 12:18 AM
Datalist selects Item after first click, but does apply the SelectedItemTemplate after the second click only Dirk Meusel ASP .Net 1 08-19-2003 09:56 AM
datagrid within SelectedItemTemplate of another grid Randy Vande Hei ASP .Net 0 08-04-2003 08:49 PM
datagrid within SelectedItemTemplate of another grid Randy Vande Hei ASP .Net Datagrid Control 0 08-04-2003 08:49 PM



Advertisments