医药CRM系统开发

自已做医药CRM系统有四年了,终于可以算个产品了,努力市场化,今年重种将医药营销的理念加入CRM

导航

设置datagrid的背影及对单元格进行设置

Posted on 2007-02-26 19:24  hhq80  阅读(167)  评论(0编辑  收藏  举报

   //如果是数据项并且是交替项
   if(e.Item.ItemType == ListItemType.Item  || e.Item.ItemType == ListItemType.AlternatingItem)
   {
    //添加自定义属性,当鼠标移过来时设置该行的背景色为"6699ff",并保存原背景色
    e.Item.Attributes.Add("onmouseover","currentcolor=this.style.backgroundColor;this.style.backgroundColor='#6699ff'");
    //添加自定义属性,当鼠标移走时还原该行的背景色
    e.Item.Attributes.Add("onmouseout","this.style.backgroundColor=currentcolor");

   }
   //如果当前项不为空
   if(e.Item.ItemIndex != -1 )
   {
    //取得当前项的索引值加1,因为项的索引值是从0开始的.
    int orderID = e.Item.ItemIndex+1;
    //设置第一列为的单元格内容为当前项索引值加1
    e.Item.Cells[0].Text = orderID.ToString();

    //如果库存为零,则设置该行的背景色为蓝色
    if((e.Item.Cells[8].Text)=="0.00")
     e.Item.Cells[8].CssClass="ItemStyleRightBoldRed";
   }