Esempio n. 1
0
        public virtual string GetCellWidthStyle(Field field, Json.CustomView cv, bool editable, string rowType)
        {
            string wStyle   = string.Empty;
            string minWidth = string.Empty;

            if (field.TableCellMinWidth > 10)
            {
                minWidth = "min-width: " + field.TableCellMinWidth.ToString() + "px;";
            }
            if (cv != null && cv.Fields != null && cv.Fields.ContainsKey(field.Name) && cv.Fields[field.Name] != null)
            {
                int width;
                if (Int32.TryParse(cv.Fields[field.Name].width, out width))
                {
                    if (width < 20)
                    {
                        width = 20;
                    }
                    wStyle = "width: " + width + "px;";
                }
            }
            else if (field.View.GridDisplayType != GridDisplayType.FitToWindowWidth)
            {
                int width = 80;
                wStyle = "width: " + width + "px;";
            }

            return(minWidth + wStyle);
        }
Esempio n. 2
0
        public virtual string GetCellAlignmentStyle(Field field, Json.CustomView cv, bool editable, string rowType)
        {
            if (field.TextAlignment == TextAlignment.inherit)
            {
                return(string.Empty);
            }

            return("text-align:" + field.TextAlignment.ToString() + ";");
        }
Esempio n. 3
0
        public virtual string GetCellHeightStyle(Field field, Json.CustomView cv, bool editable, string rowType)
        {
            string height     = string.Empty;
            string viewHeight = field.View.RowHeight;

            if (string.IsNullOrEmpty(viewHeight))
            {
                HtmlControlType controlType = field.GetHtmlControlType();

                if (controlType == HtmlControlType.TextArea)
                {
                    height = "line-height: auto; height: auto;";
                }
            }
            else
            {
                height = "line-height: " + field.View.RowHeight + "px; height:" + field.View.RowHeight + "px;";
            }

            return(height);
        }