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

Multiple ListViews w/RadAjaxManager

3 Answers 121 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Angie
Top achievements
Rank 1
Angie asked on 27 May 2010, 10:27 PM
I am working with 3 ListViews on one page.  The first listview updates the second when an item is selected.  The second updates the third when an item in the second ListView is selected.

I would like the third listview to be hidden until an item has been selected from the second listview, however, I am getting an error with the Ajax manager that the panel for the third listview cannot be found.

I have tried it with "visible=false", "style=display:none", as well as not binding it until needed, all options cause errors with the RadAjaxmanager.

Can you please help me figure out the proper way to show/hide the listviews while still making them available for ajax updating??

Thank you!  Code below:

 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" > 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="pGalleries">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pGalleries" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="pGalleryImages">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pGalleryImages" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
              <telerik:AjaxSetting AjaxControlID="pImage">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="pImage" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Forest" InitialDelayTime="0">  
        </telerik:RadAjaxLoadingPanel> 
         
 
       <!-- GALLERY VIEW --> 
            <telerik:RadListView ID="lvGalleries" runat="server"  PageSize="2"  OnItemCommand="lvGalleries_ItemCommand" OnNeedDataSource="lvGalleries_NeedDataSource" 
            ItemPlaceholderID="PlaceHolder1" AllowPaging="true" DataKeyNames="gallery_id">  
            <LayoutTemplate> 
             <div style="float:left">  
                    <asp:Panel ID="pGalleries" runat="server">  
                            <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> 
                         
                         <telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="2" Skin="Forest">  
                            <Fields> 
                                <telerik:RadDataPagerSliderField  /> 
                            </Fields> 
                        </telerik:RadDataPager> 
                    </asp:Panel> 
                </div> 
            </LayoutTemplate> 
            <ItemTemplate> 
                <div class="category" style="padding:5px;width:120px;">  
                  <asp:ImageButton ID="imgGallery" runat="server" AlternateText='<%# Eval("gallery_name") %>' 
                                    Width="120px" CommandName="Select" ImageUrl='<%# String.Format("~/images/2010/80s Party IV/thumbs/{0}",Eval("gallery_image")) %>' /> 
                                           </div> 
            </ItemTemplate> 
              
        </telerik:RadListView> 
        
 
       
 
    <!-- GALLERY IMAGES VIEW --> 
    <telerik:RadListView ID="lvGalleryImages" runat="server" DataKeyNames="gallery_image_id"  OnNeedDataSource="lvGalleryImages_NeedDataSource" OnItemCommand="lvGalleryImages_ItemCommand" ItemPlaceholderID="PlaceHolder2" AllowPaging="true" > 
            <LayoutTemplate> 
                <div class="sushibar">  
                    <asp:Panel ID="pGalleryImages" runat="server">  
                       <fieldset> 
                        <legend>Gallery Images</legend> 
                            <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder> 
                       </fieldset> 
                        <telerik:RadDataPager ID="RadDataPager2" runat="server" PageSize="6" Skin="Forest">  
                            <Fields> 
                                <telerik:RadDataPagerSliderField  /> 
                            </Fields> 
                        </telerik:RadDataPager> 
                    </asp:Panel> 
                </div> 
            </LayoutTemplate> 
            <ItemTemplate> 
                    <asp:ImageButton ID="GalleryImage" runat="server" AlternateText='<%# Eval("image_caption") %>' 
                        Width="120px" CommandName="Select" ImageUrl='<%# String.Format("~/images/2010/80s Party IV/thumbs/{0}",Eval("gallery_image")) %>' /> 
                 
            </ItemTemplate> 
            
        </telerik:RadListView> 
          
          
          
         <!-- SINGLE IMAGE VIEW --> 
       <telerik:RadListView ID="lvImage" runat="server"   OnNeedDataSource="lvImage_NeedDataSource" ItemPlaceholderID="PlaceHolder2" AllowPaging="true" > 
            <LayoutTemplate> 
                <div style="float:left">  
                    <asp:Panel ID="pImage" runat="server">  
                       <fieldset> 
                        <legend>Gallery Images</legend> 
                            <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder> 
                       </fieldset> 
                        <telerik:RadDataPager ID="RadDataPager2" runat="server" PageSize="1" Skin="Forest">  
                            <Fields> 
                                <telerik:RadDataPagerSliderField  /> 
                            </Fields> 
                        </telerik:RadDataPager> 
                    </asp:Panel> 
               </div> 
            </LayoutTemplate> 
            <ItemTemplate> 
                    <asp:ImageButton ID="GalleryImage" runat="server" AlternateText='<%# Eval("image_caption") %>' 
                        Width="500px" CommandName="Select" ImageUrl='<%# String.Format("~/images/2010/80s Party IV/slideshow/{0}",Eval("gallery_image")) %>' /> 
               <%# Eval("image_caption") %> 
            </ItemTemplate> 
            
        </telerik:RadListView> 
        

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 28 May 2010, 10:49 AM
Hi Angie,

I'm afraid that directly updating controls with visible set to false is not supported by RadAjaxManager. You should wrap the control inside an asp:panel, which should be set as updated control instead of RadListView.  Therefore in your scenario you should move the panels outside of the Layout templates.

All the best,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Angie
Top achievements
Rank 1
answered on 02 Jun 2010, 10:51 PM
Maybe if I try to explain it from a different direction:

I have the two listviews and I'm using the NeedDataSource event for each listview.  I don't want the listview to load the data until a button is clicked, rather than on page load.

What's the best way to go about this?

Thanks.
0
Rosen
Telerik team
answered on 04 Jun 2010, 02:53 PM
Hi Angie,

I have attached a small sample page which demonstrates similar to the requested scenario.

Regards,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ListView
Asked by
Angie
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Angie
Top achievements
Rank 1
Share this question
or