Пример #1
0
        public virtual string Render(T dataItem, IList <IGridDataKey <T> > dataKeys, ControllerContext context)
        {
            if (CheckIfHidden(dataItem))
            {
                return(string.Empty);
            }
            var url = dataItem == null
                ? context.BuildUrl(RouteValueDictionary, dataKeys)
                : context.BuildUrl(dataItem, RouteValueDictionary, dataKeys);

            if (!TextOnly)
            {
                var image = Tag.A(url).Style("display:inline-block")
                            .Html(Tag.Span.Class("grid-icon", ImageUrl).Title(AlternateText))
                            .MergeAttributes(HtmlAttributes.DictionaryParse());
                return(image.ToString());
            }
            return(Tag.A(url).Style("display:inline-block").Class(ImageUrl)
                   .Text(AlternateText).MergeAttributes(HtmlAttributes.DictionaryParse())
                   .ToString());
        }