protected override void AppendCellContent(IHtmlNode td, object dataItem) { object value = null; if (dataItem != null && Data != null) { if (!Data.Any(i => i.Selected)) { var key = Value((TModel)dataItem); if (key != null) { var selectedItem = Data.FirstOrDefault(i => i.Value.Equals(key.ToString())); if (selectedItem != null) { value = selectedItem.Text; } } } else { value = value = Data.First(i => i.Selected).Text; } } if (value != null) { SetCellContent(td, ApplyFormat(value)); } else { td.Html(" "); } }
protected override void AppendCellContent(IHtmlNode td, object dataItem) { var htmlHelper = new HtmlHelper <TModel>(ViewContext, new GridViewDataContainer <TModel>((TModel)dataItem, ViewContext.ViewData)); var content = htmlHelper.DisplayFor(Expression).ToHtmlString(); content = content.HasValue() ? content : " "; td.Html(content); }
protected void AppendHeaderContent(IHtmlNode container) { if (HeaderTemplate != null && HeaderTemplate.HasValue()) { HeaderTemplate.Apply(container); } else { container.Html(Title.HasValue() ? Title : " "); } }
protected void SetCellContent(IHtmlNode td, string content) { if (Encoded) { td.Text(content); } else { td.Html(content); } }
private void AppendContent(IHtmlNode td) { if (Html.HasValue()) { td.Html(Html); } else if (Template != null) { Template(DataItem, td); } }
protected override void AppendCellContent(IHtmlNode td, object dataItem) { object value = null; if (dataItem != null) { value = Value((TModel)dataItem); } if (value != null) { SetCellContent(td, ApplyFormat(value)); } else { td.Html(" "); } }
private void AppendHint(IHtmlNode div, GridGroupingData groupingData) { div.Html(groupingData.Messages.Empty); }
private void AppendHint(IHtmlNode div, GridGroupingData groupingData) { div.Html(groupingData.Hint); }