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

Help with Sort Inside RadListView and RadAjaxPanel Sort Buttons Disappear

1 Answer 75 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Todd
Top achievements
Rank 1
Todd asked on 05 May 2010, 11:53 PM
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!

1 Answer, 1 is accepted

Sort by
0
Todd
Top achievements
Rank 1
answered on 06 May 2010, 12:21 AM
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.
Tags
ListView
Asked by
Todd
Top achievements
Rank 1
Answers by
Todd
Top achievements
Rank 1
Share this question
or