problems with div and datalists

g_r_a_robinson

Regular
Joined
Jan 13, 2004
Messages
71
Hi

I have successfully managed to cause my datalist to scroll and it works great. My problem its causes my list items to appear at the bottom of the scroll box instead of the top. I can cause them to appear at the top by scrolling my bar downwards but I need them to appear at the top when it first loads up.

In other words there a great big space between my the top of my scrollbox and my first datalist item. I do have another user control above this which looks about the same size has the 'big space' but I'm not sure if this is the cause. Heres my code:
<DIV id="" style="Z-INDEX: 103; LEFT: -2px; VERTICAL-ALIGN: top; POSITION: relative; TOP: 188px; HEIGHT: 495px; SCROLLBAR-FACE-COLOR: #eeeeff; OVERFLOW-X: auto; SCROLLBAR-HIGHLIGHT-COLOR: #006699; OVERFLOW: scroll; SCROLLBAR-SHADOW-COLOR: #333333; SCROLLBAR-3DLIGHT-COLOR: #ffffff; SCROLLBAR-ARROW-COLOR: #006699; SCROLLBAR-TRACK-COLOR: #ffffff; BORDER-BOTTOM: black 1px solid; SCROLLBAR-DARKSHADOW-COLOR: #cccccc; HEIGHT: 495px">
<asp:datalist id="NoteList_LST" style="Z-INDEX: 103; LEFT: -2px; POSITION: absolute; TOP: 252px" runat="server" Width="100%" CellSpacing="1" CellPadding="3" BorderWidth="1px" BorderStyle="None" BorderColor="#E7E7FF" GridLines="Horizontal" BackColor="White" DataKeyField="NoteID">
<SelectedItemStyle Font-Bold="True" ForeColor="#F7F7F7" BackColor="Teal"></SelectedItemStyle>
<SelectedItemTemplate>
<TABLE width="100%">
<TR>
<TD id="Td1" style="FONT-WEIGHT: bold; BACKGROUND-IMAGE: url(..\..\..\WebFiles\images\barForSelected.gif); COLOR: white" colSpan="2" runat="server"><%# DataBinder.Eval(Container.DataItem, NotesData.BYWHO_FIELD) %>
made an entry
<%# DataBinder.Eval(Container.DataItem, NotesData.DATE_FIELD) %>
</TD>
</TR>
<TR>
<TD><%# DataBinder.Eval(Container.DataItem, NotesData.NOTE_DESCRIPTION_FIELD) %></TD>
</TR>
<TR> <!-- <TD>
<asp:Label "<%# DataBinder.Eval(Container.DataItem, NotesData.NOTE_READ_FIELD).ToString()=="Read" ? System.Drawing.Color.Red : System.Drawing.Color.White %></asp:Label>
</td>--></TR>
<TR>
<!-- <TD id="Td3" runat="server">
<asp:Label id="Label1" Runat="server">
<b>The
<%# DataBinder.Eval(Container.DataItem, NotesData.FK_ACTION_PERFORMED_FIELD) %>
took
<%# DataBinder.Eval(Container.DataItem, NotesData.TOTAL_HOURS_FIELD) %>
hour(s) </b>
</asp:Label></TD>
<TD align="right">
<asp:Button id="Button2" Width="40" Runat="server" Text="Read" CommandName="Read_Notes"></asp:Button></TD>-->
</TR>
</TABLE>
</SelectedItemTemplate>
<AlternatingItemStyle BackColor="#F7F7F7"></AlternatingItemStyle>
<ItemStyle ForeColor="#4A3C8C" BackColor="#E7E7FF"></ItemStyle>
<ItemTemplate>
<TABLE width="100%">
<TR>
<TD id="RowHeaderBar" style="FONT-WEIGHT: bold; BACKGROUND-IMAGE: url(..\..\..\WebFiles\images\barForNotes.gif); COLOR: white" colSpan="2" runat="server"><%# DataBinder.Eval(Container.DataItem, NotesData.BYWHO_FIELD) %>
made an entry
<%# DataBinder.Eval(Container.DataItem, NotesData.DATE_FIELD) %>
</TD>
<TD id="RowHeaderBar_For_System" style="COLOR: black" colSpan="2" runat="server">System
note created by
<%# DataBinder.Eval(Container.DataItem, NotesData.BYWHO_FIELD) %>
on
<%# DataBinder.Eval(Container.DataItem, NotesData.DATE_FIELD) %>
</TD>
<TD id="RowHeaderBar_For_UnRead" style="FONT-WEIGHT: bold; BACKGROUND-IMAGE: url(..\..\..\WebFiles\images\barForUnRead.gif); COLOR: white" colSpan="2" runat="server"><%# DataBinder.Eval(Container.DataItem, NotesData.BYWHO_FIELD) %>
made an entry
<%# DataBinder.Eval(Container.DataItem, NotesData.DATE_FIELD) %>
</TD>
</TR>
<TR>
<TD><%# DataBinder.Eval(Container.DataItem, NotesData.NOTE_DESCRIPTION_FIELD) %></TD>
</TR>
<TR> <!-- <TD>
<asp:Label "<%# DataBinder.Eval(Container.DataItem, NotesData.NOTE_READ_FIELD).ToString()=="Read" ? System.Drawing.Color.Red : System.Drawing.Color.White %></asp:Label>
</td>--></TR>
<TR>
<TD id="Bottom_Line" runat="server">
<asp:Label id="Total_Label" Runat="server">
<b>The
<%# DataBinder.Eval(Container.DataItem, NotesData.FK_ACTION_PERFORMED_FIELD) %>
took
<%# DataBinder.Eval(Container.DataItem, NotesData.TOTAL_HOURS_FIELD) %>
hour(s) </b>
</asp:Label></TD>
<TD align="right">
<asp:Button id="Edit_Note_BTN" Runat="server" Text="Edit" CommandName="Edit_Notes"></asp:Button>
<asp:Button id="Read_Note_BTN" Width="40" Runat="server" Text="Read" CommandName="Read_Notes"></asp:Button></TD>
</TR>
</TABLE>
</ItemTemplate>
<HeaderStyle Font-Bold="True" ForeColor="#F7F7F7" BackColor="#4A3C8C"></HeaderStyle>
</asp:datalist>

</div>
<asp:panel id="Calendar_On_Notescreen_PNL" style="Z-INDEX: 104; LEFT: 0px; POSITION: absolute; TOP: 250px" runat="server" Height="24px" Width="119px">
<uc1:CalendarAndManager id="CalendarAndManager1" runat="server"></uc1:CalendarAndManager>
</asp:panel>
<asp:Panel id="ClientAndManager_PNL" style="Z-INDEX: 105; LEFT: -281px; POSITION: absolute; TOP: 251px" runat="server" Width="643px" Height="84px">
<uc1:ClientAndManager id="ClientAndManager1" runat="server"></uc1:ClientAndManager>
</asp:Panel></form>
</SCRIPT>
</body>
</HTML>
 
Back
Top