I'm trying to sort a ListView but no way. I will explain what I've done:
- I get a List of products that containt an Order field (Orden integer)
- I put this datasource to the listview and databind()
- In the ascx I have this code:
- No sorting happens.
What am I doing wrong?
Thanks
- I get a List of products that containt an Order field (Orden integer)
- I put this datasource to the listview and databind()
- In the ascx I have this code:
<asp:Panel ID="listViewPanelProductos" CssClass="ListViewList" runat="server"> <telerik:RadListView ID="lvProductos" runat="server" AllowPaging="true" EnableViewState="true" OnItemDataBound="lvProductos_ItemDataBound" ItemPlaceholderID="ProductosContainer" DataKeyNames="IdProducto"> <SortExpressions> <telerik:RadListViewSortExpression FieldName="Orden" SortOrder="Ascending" /> </SortExpressions> <LayoutTemplate> <fieldset id="fieldSet" class="fieldSet"> <asp:PlaceHolder ID="ProductosContainer" runat="server" /> <div style="clear:both"></div> <table cellpadding="0" cellspacing="0" style="margin:auto; padding-top:15px;"> <tr> <td> <telerik:RadDataPager ID="pager" runat="server" PagedControlID="lvProductos" PageSize="10" Skin="Default" AllowSEOPaging="true" SEOPagingQueryPageKey="pag"> <Fields> <telerik:RadDataPagerButtonField FieldType="Prev" /> <telerik:RadDataPagerButtonField FieldType="Numeric" /> <telerik:RadDataPagerButtonField FieldType="Next" /> </Fields> </telerik:RadDataPager> </td> </tr> </table> </fieldset> </LayoutTemplate> <ItemTemplate> <div class="item"> <div class="tituloProducto"> <h2> <asp:HyperLink ID="lnkTitulo" Text='<%# Eval("Titulo") %>' ToolTip='<%# Eval("Titulo") %>' runat="server" EnableViewState="false" /> </h2> </div> <div class="descripcionProducto"> <asp:Label ID="lblDescripcion" runat="server" EnableViewState="false"></asp:Label> </div> </div> </ItemTemplate> . . . . .- No sorting happens.
What am I doing wrong?
Thanks