Help with Sort Inside RadListView and RadAjaxPanel Sort Buttons Disappear

2 posts, 0 answers
  1. Todd
    Todd avatar
    4 posts
    Member since:
    May 2008

    Posted 05 May 2010 Link to this post

    Hi,

    I am trying to figure out how to apply a custom sort using the RadListView which is inside a RadAjaxPanel.  Whenever I click on a LinkButton to cause a sort change, all the link buttons disappear.

    Here is some code that shows the ascx layout:
        <telerik:RadAjaxLoadingPanel   
            ID="RadAjaxLoadingPanelDiscussion"  
            Transparency="1" 
            Width="100%" 
            Height="100%" 
            runat="server" /> 
        <telerik:RadAjaxPanel  
            ID="RadAjaxPanelDiscussion"  
            LoadingPanelID="RadAjaxLoadingPanelDiscussion" 
            runat="server"  
            > 
            <telerik:RadListView  
                ID="RadListViewDiscussion"  
                DataSourceID="LinqDataSource" 
                ItemPlaceholderID="ProductsHolder" 
                OnItemCommand="RadListViewDiscussion_ItemCommand" 
                runat="server" 
                > 
                <LayoutTemplate> 
                    <div id="discussion-sort"
                        <table  cellpadding="0" cellspacing="0" width="100%;" style="clear: both;"
                            <tr> 
                                <td> 
                                    Sort by:  
                                </td> 
                                <td> 
                                    <asp:LinkButton  
                                        ID="LinkButtonSubject"  
                                        CommandName="Sort" 
                                        CommandArgument="Subject" 
                                        Visible='<%# this.SortSubject %>' 
                                        Font-Bold='<%# this.SelectedSort == DiscussionListWebPart.DefaultSortOption.Subject %>' 
                                        runat="server"  
                                        > 
                                        Subject  
                                        <asp:Image 
                                            ID="ImageSubject" 
                                            Visible='<%# this.SelectedSort == DiscussionListWebPart.DefaultSortOption.Subject %>' 
                                            ImageUrl='<%# this.GetSortDirectionImageUrl() %>' 
                                            runat="server" 
                                            /> 
                                    </asp:LinkButton> 
                                    <asp:Literal ID="Literal1" 
                                        Text=" | " 
                                        runat="server" 
                                        Visible='<%# this.SortSubject %>' 
                                        > 
                                    </asp:Literal> 
                                </td> 
                                <td> 
                                    <asp:LinkButton  
                                        ID="LinkButtonBody"  
                                        CommandName="Sort" 
                                        CommandArgument="Body" 
                                        Visible='<%# this.SortBody %>' 
                                        Font-Bold='<%# this.SelectedSort == DiscussionListWebPart.DefaultSortOption.Body %>' 
                                        runat="server"  
                                        > 
                                        Body  
                                        <asp:Image 
                                            ID="ImageBody" 
                                            Visible='<%# this.SelectedSort == DiscussionListWebPart.DefaultSortOption.Body %>' 
                                            ImageUrl='<%# this.GetSortDirectionImageUrl() %>' 
                                            runat="server" 
                                            /> 
                                    </asp:LinkButton> 
     
    ... 

    The LinkButton.Visible property does not change, is always true, so that isn't the issue.  It has something to do with the ajax call.  Also, there is a Literal that has a visibility set to the same property.  The Literals don't disappear, but all the LinkButtons that apply sort do.

    Is there something else I need to wire up?

    Thanks!
  2. Todd
    Todd avatar
    4 posts
    Member since:
    May 2008

    Posted 05 May 2010 Link to this post

    I figured it out.  I added a normal asp:button to the page and it didn't disappear.  Then I removed the nested <asp:Image inside of the <asp:LinkButton> and things worked.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top