/// <summary>
 /// 设定字段名
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="field">字段名的设定非常重要,是表格数据列的唯一标识,默认属性对应的名字</param>
 /// <returns></returns>
 public static GridColumn <T> SetField <T>(this GridColumn <T> self, string field)
     where T : TopBasePoco
 {
     self.Field = field;
     return(self);
 }
 /// <summary>
 /// 设定标题名称
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="title">即表头各列的标题,默认属性对应的 DisplayName 或 属性名 </param>
 /// <returns></returns>
 public static GridColumn <T> SetTitle <T>(this GridColumn <T> self, string title)
     where T : TopBasePoco
 {
     self.Title = title;
     return(self);
 }
Beispiel #3
0
 /// <summary>
 /// 设置某列是否应该尽量充满
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="flex"></param>
 /// <returns></returns>
 public static GridColumn <T> SetFlex <T>(this GridColumn <T> self, int?flex) where T : TopBasePoco
 {
     self.Flex = flex;
     return(self);
 }
Beispiel #4
0
 public static GridColumn <T> SetSortable <T>(this GridColumn <T> self, bool sortable = false) where T : TopBasePoco
 {
     self.Sortable = sortable;
     return(self);
 }
 public static GridColumn <T> SetHidden <T>(this GridColumn <T> self, bool hidden = true) where T : TopBasePoco
 {
     return(self);
 }
 /// <summary>
 /// 设定列宽不可改变
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="unresize"></param>
 /// <returns></returns>
 public static GridColumn <T> SetUnResize <T>(this GridColumn <T> self, bool unresize = true)
     where T : TopBasePoco
 {
     self.UnResize = unresize;
     return(self);
 }
Beispiel #7
0
 /// <summary>
 /// 设置禁止导出此列数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <returns></returns>
 public static GridColumn <T> SetDisableExport <T>(this GridColumn <T> self) where T : TopBasePoco
 {
     self.DisableExport = true;
     return(self);
 }
 /// <summary>
 /// 设定是否固定列
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="fixed">如果设置 Left 或 Right,则对应的列将会被固定在左或右,不随滚动条而滚动。</param>
 /// <returns></returns>
 public static GridColumn <T> SetFixed <T>(this GridColumn <T> self, GridColumnFixedEnum @fixed)
     where T : TopBasePoco
 {
     self.Fixed = @fixed;
     return(self);
 }
Beispiel #9
0
 /// <summary>
 /// 本列背景色函数
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="backGroundFunc"></param>
 /// <returns></returns>
 public static GridColumn <T> SetBackGroundFunc <T>(this GridColumn <T> self, Func <T, string> backGroundFunc) where T : TopBasePoco
 {
     self.BackGroundFunc = backGroundFunc;
     return(self);
 }
Beispiel #10
0
 /// <summary>
 /// 设置本列是否显示汇总
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="show">是否显示</param>
 /// <returns></returns>
 public static GridColumn <T> SetShowTotal <T>(this GridColumn <T> self, bool show = true) where T : TopBasePoco
 {
     self.ShowTotal = show;
     return(self);
 }
Beispiel #11
0
 /// <summary>
 /// 本列前景色函数
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="foreGroundFunc"></param>
 /// <returns></returns>
 public static GridColumn <T> SetForeGroundFunc <T>(this GridColumn <T> self, Func <T, string> foreGroundFunc) where T : TopBasePoco
 {
     self.ForeGroundFunc = foreGroundFunc;
     return(self);
 }
Beispiel #12
0
 /// <summary>
 /// 计算列值的表达式
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="columnExp"></param>
 /// <returns></returns>
 public static GridColumn <T> SetColumnExp <T>(this GridColumn <T> self, Expression <Func <T, object> > columnExp) where T : TopBasePoco
 {
     self.ColumnExp = columnExp;
     return(self);
 }
Beispiel #13
0
 ///// <summary>
 ///// 时间与数字类型Format
 ///// </summary>
 ///// <typeparam name="T"></typeparam>
 ///// <param name="self"></param>
 ///// <param name="format"></param>
 ///// <returns></returns>
 //public static GridColumn<T> SetFormat<T>(this GridColumn<T> self, string format) where T : TopBasePoco
 //{
 //    self.StringFormat = format;
 //    return self;
 //}
 /// <summary>
 /// 列内容的格式化函数
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="format"></param>
 /// <returns></returns>
 public static GridColumn <T> SetFormat <T>(this GridColumn <T> self, ColumnFormatCallBack <T> format) where T : TopBasePoco
 {
     self.Format = format;
     return(self);
 }
 /// <summary>
 /// 设定列宽
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="width">列宽的设定也通常是必须的(“特殊列”除外,如:复选框列、工具列等),它关系到表格的整体美观程度。</param>
 /// <returns></returns>
 public static GridColumn <T> SetWidth <T>(this GridColumn <T> self, int width)
     where T : TopBasePoco
 {
     self.Width = width;
     return(self);
 }
Beispiel #15
0
 /// <summary>
 /// Id
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="id"></param>
 /// <returns></returns>
 public static GridColumn <T> SetId <T>(this GridColumn <T> self, string id) where T : TopBasePoco
 {
     self.Id = id;
     return(self);
 }
        ///// <summary>
        ///// 设定当前列头 列横跨的单元格数
        ///// </summary>
        ///// <typeparam name="T"></typeparam>
        ///// <param name="self"></param>
        ///// <param name="colspan">这种情况下不用设置 Field 和 Width </param>
        ///// <returns></returns>
        //public static GridColumn<T> SetColspan<T>(this GridColumn<T> self, int colspan)
        //    where T : TopBasePoco
        //{
        //    self.Colspan = colspan;
        //    return self;
        //}

        ///// <summary>
        ///// 设定当前列头 纵向跨越的单元格数
        ///// </summary>
        ///// <typeparam name="T"></typeparam>
        ///// <param name="self"></param>
        ///// <param name="rowspan">纵向跨越的单元格数</param>
        ///// <returns></returns>
        //public static GridColumn<T> SetRowspan<T>(this GridColumn<T> self, int rowspan)
        //    where T : TopBasePoco
        //{
        //    self.Rowspan = rowspan;
        //    return self;
        //}

        /// <summary>
        /// 设定是否允许排序 (ASCII码排序)
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="self"></param>
        /// <param name="sort">如果设置 true,则在对应的表头显示排序icon,从而对列开启排序功能。</param>
        /// <returns></returns>
        public static GridColumn <T> SetSort <T>(this GridColumn <T> self, bool sort = true)
            where T : TopBasePoco
        {
            self.Sort = sort;
            return(self);
        }
Beispiel #17
0
 /// <summary>
 /// 列头
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="header"></param>
 /// <returns></returns>
 public static GridColumn <T> SetHeader <T>(this GridColumn <T> self, string header) where T : TopBasePoco
 {
     self.Title = header;
     return(self);
 }
 /// <summary>
 /// 设定对齐方式
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="align"></param>
 /// <returns></returns>
 public static GridColumn <T> SetAlign <T>(this GridColumn <T> self, GridColumnAlignEnum align)
     where T : TopBasePoco
 {
     self.Align = align;
     return(self);
 }
Beispiel #19
0
 /// <summary>
 /// 本列是否需要分组
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="needGroup"></param>
 /// <returns></returns>
 public static GridColumn <T> SetNeedGroup <T>(this GridColumn <T> self, bool needGroup) where T : TopBasePoco
 {
     self.NeedGroup = needGroup;
     return(self);
 }
 /// <summary>
 /// 是否隐藏
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="hide"></param>
 /// <returns></returns>
 public static GridColumn <T> SetHide <T>(this GridColumn <T> self, bool hide = true) where T : TopBasePoco
 {
     self.Hide = hide;
     return(self);
 }
Beispiel #21
0
 public static GridColumn <T> SetLocked <T>(this GridColumn <T> self, bool locked) where T : TopBasePoco
 {
     self.IsLocked = locked;
     return(self);
 }
 /// <summary>
 /// 设定自定义单元格编辑类型
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="editType">单元格编辑类型</param>
 /// <returns></returns>
 public static GridColumn <T> SetOnlyEditType <T>(this GridColumn <T> self, EditTypeEnum editType = EditTypeEnum.Text)
     where T : TopBasePoco
 {
     self.EditType = editType;
     return(self);
 }
Beispiel #23
0
 /// <summary>
 /// 是否允许换行
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="self"></param>
 /// <param name="allowMultiLine"></param>
 /// <returns></returns>
 public static GridColumn <T> SetAllowMultiLine <T>(this GridColumn <T> self, bool allowMultiLine) where T : TopBasePoco
 {
     self.AllowMultiLine = allowMultiLine;
     return(self);
 }