This is a migrated thread and some comments may be shown as answers.

Grid Sorting Within Tabstrip

1 Answer 32 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jillian
Top achievements
Rank 1
Jillian asked on 07 Mar 2012, 03:14 PM
I have a tabstrip with multiple tabs.  Inside each tab, I have a Grid that I need to order by a date in descending order.  I can add the sort fine, but when I add descending, the tab strip returns an error "Overload resolution failed because no accessible 'Content' can be called with these arguments: 'Public Function Content(value As String) As Telerik.Web.Mvc.UI.TabStripItemBuilder': Lambda expression cannot be converted to 'String' because 'String' is not a delegate type. 'Public Function Content(value As System.Func(Of Object, Object)) As Telerik.Web.Mvc.UI.TabStripItemBuilder': Expression does not produce a value. 'Public Function Content(value As System.Action) As Telerik.Web.Mvc.UI.TabStripItemBuilder': Expression does not produce a value."

How can I sort my grid within my tab strip.  Code for one tab with grid below.

<%Dim tabmenu As TabStrip = Html.Telerik().TabStrip().Name("AdminDashboard") _
        .Items(Function(tabstrip)
                        tabstrip.Add().Text("All Events").Url(Url.Action("Index""Admin"New With {.selectedIndex = 0})).Content(Sub()%>
                        <% Html.Telerik().Grid(Model.Events).Name("Events") _
                               .DataKeys(Function(datakey) datakey.Add(Function(i) i.EventID)) _
                               .Columns(Function(column) column.Bound(Function(i) i.EventName)) _
                               .Columns(Function(column) column.Bound(Function(i) i.EmailEvent.SubjectLine)) _
                               .Columns(Function(column) column.Bound(Function(i) i.Status)) _
                               .Columns(Function(column) column.Bound(Function(i) i.DateTime).Title("Date Created").Format("{0:d}")) _
                               .Columns(Function(column) column.Bound(Function(i) i.ScheduleDate).Width(200)) _
                               .Columns(Function(column) column.Bound(Function(i) i.DeploymentDate).Width(200)) _
                               .Pageable() _
                               .Sortable(Function(sorting) sorting.OrderBy(Function(order) order.Add(Function(i) i.DateTime).Descending)) _
                               .Filterable(Function(filtering) filtering.Filters(Function(filter) filter.Add(Function(o) o.DateTime).IsGreaterThan(Date.Today.AddMonths(-3)))) _
                               .Render()%>
                   <%End Sub)
        End Function) _
        .SelectedIndex(Convert.ToInt32(Model.selectedIndex))
tabmenu.Render()%>

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 12 Mar 2012, 01:58 PM
Hello Jillian,

As examining your code I noticed that you are using the Descending method as a property (i.e. you are missing the parentheses).
Your code should look like this:
.Sortable(Function(sorting) sorting.OrderBy(Sub(order) order.Add(Function(i) i.DateTime).Descending())) _

I hope this helps.

Kind regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Jillian
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or