当前位置:首页 > C#教程 > C#高级

C#小常识,持续更新..

            1.cs部分添加隐藏样式IntegratedEquipmentblock.Style.Add("display", "none");

 

            2             .gridview添加奇偶行样式             protected             void gvIntegratedEquipmentList_RowDataBound(object sender, GridViewRowEventArgs e)
        {

            //添加样式-----------beginswitch (e.Row.RowType)
            {
                case DataControlRowType.Header:
                    e.Row.CssClass = "table01_th";
                    break;
                case DataControlRowType.DataRow:
                    if (e.Row.RowIndex > -1)
                    {
                        // 奇数行if (e.Row.RowIndex % 2 == 0)
                        {
                            e.Row.CssClass = "table01_singlar";
                        }
                        else                         {
                            e.Row.CssClass = "table01_double";
                        }
                    }
                    break;
            }
            //------------------end         }

 

            3             .添加单元格背景色
e.Row.Cells[             0].BackColor = (System.Drawing.Color)new WebColorConverter().ConvertFromString("#d0cfce");

【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!

相关教程推荐

其他课程推荐