Ejemplo n.º 1
0
        protected void BaseRenderRowEnd(GridRowViewData <T> rowData)
        {
            bool rendered = GridModel.Sections.Row.EndSectionRenderer(rowData, new RenderingContext(Writer, Context, engines));

            if (!rendered)
            {
                RenderRowEnd();
            }
        }
Ejemplo n.º 2
0
        protected override void RenderStartCell(GridColumn <T> column, GridRowViewData <T> rowData)
        {
            string attrs = BuildHtmlAttributes(column.Attributes(rowData));

            if (attrs.Length > 0)
            {
                attrs = " " + attrs;
            }

            RenderText(string.Format("<td{0}>", attrs));
        }
Ejemplo n.º 3
0
        private IDictionary <string, object> GetAttributesFromRow(GridRowViewData <T> row)
        {
            var dictionary = new Dictionary <string, object>();
            var pairs      = attributes.SelectMany(attributeFunc => attributeFunc(row));

            foreach (var pair in pairs)
            {
                dictionary[pair.Key] = pair.Value;
            }

            return(dictionary);
        }
Ejemplo n.º 4
0
        protected virtual void RenderItem(GridRowViewData <T> rowData)
        {
            BaseRenderRowStart(rowData);

            foreach (var column in VisibleColumns())
            {
                RenderStartCell(column, rowData);
                RenderCellValue(column, rowData);
                RenderEndCell();
            }

            BaseRenderRowEnd(rowData);
        }
Ejemplo n.º 5
0
        protected virtual void RenderCellValue(GridColumn <T> column, GridRowViewData <T> rowData)
        {
            var cellValue = column.GetValue(rowData.Item);

            if (cellValue != null)
            {
                if (column.CellRender != null)
                {
                    column.CellRender.Render(Writer, cellValue);
                }
                else
                {
                    RenderText(cellValue.ToString());
                }
            }
        }
Ejemplo n.º 6
0
        protected override void RenderRowStart(GridRowViewData <T> rowData)
        {
            var attributes = GridModel.Sections.Row.Attributes(rowData);

            if (!attributes.ContainsKey("class"))
            {
                attributes["class"] = rowData.IsAlternate ? "gridrow_alternate" : "gridrow";
            }

            string attributeString = BuildHtmlAttributes(attributes);

            if (attributeString.Length > 0)
            {
                attributeString = " " + attributeString;
            }

            RenderText(string.Format("<tr{0}>", attributeString));
        }
Ejemplo n.º 7
0
 protected abstract void RenderStartCell(GridColumn <T> column, GridRowViewData <T> rowViewData);
Ejemplo n.º 8
0
 protected abstract void RenderRowStart(GridRowViewData <T> rowData);