Dynamic datalist height

P

Peter

I have a datalist and I want the datalist to grow from no recors to fill the
screen, but not go beyond the screen height. How do I do that?
I've implemented the scroll bars but that's for the fixed height. I want
the datalist to grow and shrink and never go beyond the current screen
height, if it goes beyond the screen height I want to implement the scroll
bar.


Thank You



Peter


Here's my code, I've tried adding a table, but still can not get it to work.

<asp:panel ID="Panel1" runat="server" height="300px" ScrollBars="Vertical" >
<table width="100%" style="border: 1px solid; border-color: Blue"
border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>

<asp:datalist id="dlTemplateList" style="width: 100%;"
datakeyfield="ItemID" runat="server"
cellpadding="1" OnItemDataBound="dlTemplateList_ItemDataBound">
<itemtemplate>
<table class="dataliststyle">
<tr>
<td valign="top" align="left" style="width:30px">
<asp:ImageButton ID="ImageButton1" runat="server"
ImageUrl="~/images/icon_sitelog_16px.gif"
onclick="ImageButton1_Click"/>

</td>
<td style="width:320px" class="reportname">
<asp:HyperLink ID="HyperLinkReport" Runat="Server"
Text='<%# DataBinder.Eval(Container.DataItem, "ObjectName") %>'
NavigateUrl='~/DesktopModules/Report/Viewer.aspx?ReportID=<%#
DataBinder.Eval(Container.DataItem, "ItemID") %>'
Target="_top"
/>

<asp:Label ID="lblContent1" runat="server" CssClass="Normal"/>
</td>
<td>
<span id="spanInModuleB" style="overflow:auto; ">
<asp:Label ID="Label1" runat="server" CssClass="description"
Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'/>

</span>
</td>
</tr>
</table>

</itemtemplate>

</asp:datalist>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top