如题:想增加一个让它好看点。

解决方案 »

  1.   

    gridview 有detailview 应该也有的哇。
      

  2.   

    哦。说错了。我的神。是datalist 的光棒效果。我这样弄了。不行protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e)
        {
                    if (e.Item.ItemType == DataControlRowType.DataRow)
            {
                e.Item.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='gray'");
                e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor");
            }    }
      

  3.   

    试了下datalist在后台确实不行,在去找找原因下!
    你先在前台直接写上,不一定非要在后台设置
     <tr onmouseover="this.style.backgroundColor='red'" onmouseout="this.style.backgroundColor=''">
      

  4.   

    自己写CSS样式控制就可以了。没有不可以的。直接脚本!
      

  5.   

    前台加一个div,如:
            <asp:DataList ID="DataList1" runat="server" DataKeyField="id"  ........">
                <ItemTemplate>
                    <div onmouseover="currentcolor=this.style.backgroundColor;this.style.backgroundColor='#D9DAE8'" onmouseout="this.style.backgroundColor=currentcolor">
                 ...............
                 ...............
                    </div>
                </ItemTemplate>
            </asp:DataList>