Monday, 9 September 2013

Telerik MVC tabstrip ToString fails

Telerik MVC tabstrip ToString fails

I have the following issue with a Telerik component (tabstrip).
I have a HTML extension method that renders something on the page. Code
portion:
var tabstrip = Html.EagleTabstrip()
.Name(Container.GroupName)
.HtmlAttributes(new Dictionary<string, object> { {
"class", "icon-listbox-wrapper" } })
.Items(items =>
{
bool isFirst = true;
foreach (SomeClass widget in Widgets)
{
items.Add()
.Selected(isFirst)
.Text(widget.GroupName??"").Content(Html.RenderResourceWidgetContainer(widget).ToString()
/*This call is recursive, the function
has an if block just above*/);
isFirst = false;
}
});
var mvcHTMLString =
MvcHtmlString.Create(tabstrip.ToString());
return mvcHTMLString;
The ToString() call, however, fails with a very stupid(IMO) error message:
Sequence contains no matching element.
Where/what am I doing wrong? Any additional info will be provided upon
requirement, so feel free to bomb me with questions.
Thanks.

No comments:

Post a Comment