WEB开发网
开发学院WEB开发ASP.NET [原创]在ASP.NET环境下完整的datagrid填充数据后界... 阅读

[原创]在ASP.NET环境下完整的datagrid填充数据后界面动态显示填充方案

 2007-12-15 09:31:33 来源:WEB开发网   
核心提示: {for(int i=0;i<sender.Items.Count;i++){ if (i % 2 == 0) {sender.Items[i].Attributes.Add("onMouseOut","this.style.backgroundCol

   {
   for(int i=0;i<sender.Items.Count;i++)
   {
    if (i % 2 == 0)
    {
    sender.Items[i].Attributes.Add("onMouseOut","this.style.backgroundColor='"+sender.ItemStyle.BackColor.Name+"';this.style.cursor='hand';");
    sender.Items[i].Attributes.Add("onmouseOver","this.style.backgroundColor='"+mouseOverColor+"'");
    sender.Items[i].Attributes.Add("onClick","this.style.backgroundColor='"+clickColor+"'");
    }
    else if(i % 2 == 1)
    {
    sender.Items[i].Attributes.Add("onMouseOut","this.style.backgroundColor='#"+sender.AlternatingItemStyle.BackColor.Name.Remove(0,2)+"';this.style.cursor='hand';");
    sender.Items[i].Attributes.Add("onmouseOver","this.style.backgroundColor='"+mouseOverColor+"'");
    sender.Items[i].Attributes.Add("onClick","this.style.backgroundColor='"+clickColor+"'");
    }
   }
   }
   else if((sender.AlternatingItemStyle.BackColor.Name.CompareTo("ff"+Convert.ToString(sender.AlternatingItemStyle.BackColor.Name.Remove(0,2)))!=0) && (sender.ItemStyle.BackColor.Name.CompareTo("ff"+Convert.ToString(sender.ItemStyle.BackColor.Name.Remove(0,2)))!=0))
   {
   for(int i=0;i<sender.Items.Count;i++)
   {
    if (i % 2 == 0)
    {
    sender.Items[i].Attributes.Add("onMouseOut","this.style.backgroundColor='"+sender.ItemStyle.BackColor.Name+"';this.style.cursor='hand';");
    sender.Items[i].Attributes.Add("onmouseOver","this.style.backgroundColor='"+mouseOverColor+"'");
    sender.Items[i].Attributes.Add("onClick","this.style.backgroundColor='"+clickColor+"'");
    }
    else if(i % 2 == 1)
    {
    sender.Items[i].Attributes.Add("onMouseOut","this.style.backgroundColor='"+sender.AlternatingItemStyle.BackColor.Name+"';this.style.cursor='hand';");
    sender.Items[i].Attributes.Add("onmouseOver","this.style.backgroundColor='"+mouseOverColor+"'");
    sender.Items[i].Attributes.Add("onClick","this.style.backgroundColor='"+clickColor+"'");

上一页  1 2 3 4 5  下一页

Tags:原创 ASP NET

编辑录入:coldstar [复制链接] [打 印]
赞助商链接