DataList and scrollbar

K

Ken Cox [Microsoft MVP]

Put it inside a panel control and set the style like this:

STYLE="width: 200px; height: 200px; overflow: scroll;"
 
M

Monalisa

I cannot open the link. But thx anyway. I already done it.

But I need a help (because I'm new comie to .NET).
Please look this coding

<asp:panel id="Panel1" style="OVERFLOW: scroll" runat="server"
BorderStyle="Groove" Width="789px"
Height="400px">
<asp:DataList id="DataList1" runat="server" BorderStyle="None"
BorderWidth="1px" BackColor="White"
BorderColor="#CC9966" CellPadding="4" GridLines="Both">
<SelectedItemStyle Font-Bold="True" ForeColor="#663399"
BackColor="#FFCC66"></SelectedItemStyle>
<EditItemStyle Font-Bold="True" ForeColor="Fuchsia"
BackColor="LightGreen"></EditItemStyle>
<ItemStyle ForeColor="#330099" BackColor="White"></ItemStyle>
<ItemTemplate>
<asp:ImageButton id="imgBtnEdit" runat="server"
BorderStyle="Groove" AlternateText="Cancel" ImageUrl="images/edit.jpg"
CommandName="edit" ToolTip="Edit"></asp:ImageButton>
<%# DataBinder.Eval(Container.DataItem, "UserFullName") %>
<%# DataBinder.Eval(Container.DataItem, "EntryDateTime") %>
<%# DataBinder.Eval(Container.DataItem, "Notes") %>
</ItemTemplate>
<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
<HeaderStyle Font-Bold="True" ForeColor="#FFFFCC"
BackColor="#990000"></HeaderStyle>
<EditItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "UserFullName") %>
<%# DataBinder.Eval(Container.DataItem, "EntryDateTime") %>
<asp:TextBox id=txtEdit Runat="server" BorderStyle="Groove"
Width="100px" Height="30px" TextMode="MultiLine" Text='<%#
DataBinder.Eval(Container.DataItem, "Notes") %>'>
</asp:TextBox>
<asp:ImageButton id="imgBtnCancel" runat="server"
BorderStyle="Groove" AlternateText="Cancel" ImageUrl="images/reset.jpg"
CommandName="cancel" ToolTip="Cancel"></asp:ImageButton>
<asp:ImageButton id="imgBtnUpdate" runat="server"
BorderStyle="Groove" AlternateText="Update" ImageUrl="images/save.jpg"
CommandName="update" ToolTip="Update"></asp:ImageButton>
</EditItemTemplate>
</asp:DataList>
</asp:panel>

private void DataList1_EditCommand(object source,
System.Web.UI.WebControls.DataListCommandEventArgs e)

{

DataList1.EditItemIndex = e.Item.ItemIndex;

DataList1.DataBind();

}

The problem is when I click edit, the datalist return blank... not display
edititemtemplate why?

Tks
 

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

No members online now.

Forum statistics

Threads
474,265
Messages
2,571,069
Members
48,771
Latest member
ElysaD

Latest Threads

Top