ItemTemplate postback problem

7 posts, 0 answers
  1. Chad
    Chad avatar
    7 posts
    Member since:
    Jun 2009

    Posted 25 Aug 2009 Link to this post

    Hello everyone,

    I have a splitbutton with an radtoolbarbutton that is a template. The template works fine and displays perfectly, however when I do a postback on the page, the template disappears and i see nothing. Has anyone experienced this before. The RadToolBar is below:

     <telerik:RadToolBar ID="RadToolBarGridMenu" runat="server" Width="100%"  
                onbuttonclick="RadToolBarGridMenu_ButtonClick" Skin="Black" > 
                <Items> 
                    <telerik:RadToolBarButton Text="Bulk Edit Selected" Value="Edit"></telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton Text="Update Data" Visible="false" Value="Update"></telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton Text="Cancel Bulk Edit" Visible="false" Value="Cancel"></telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton IsSeparator="true" />           
                    <telerik:RadToolBarButton Text="Disable Paging" Value="Paging"></telerik:RadToolBarButton>       
                    <telerik:RadToolBarButton Text="Expand All" Value="Expand" Visible="false" /> 
                    <telerik:RadToolBarButton Text="Collapse All" Value="Collapse" Visible="false" />      
                    <telerik:RadToolBarButton IsSeparator="true" /> 
                    <telerik:RadToolBarDropDown Text="Export"
                        <Buttons> 
                            <telerik:RadToolBarButton Text="Export To PDF" CommandName="PDF" /> 
                            <telerik:RadToolBarButton Text="Export To Word" CommandName="Word" /> 
                            <telerik:RadToolBarButton Text="Export To Excel" CommandName="Excel" /> 
                        </Buttons> 
                    </telerik:RadToolBarDropDown>     
                    <telerik:RadToolBarButton IsSeparator="true" /> 
                    <telerik:RadToolBarSplitButton Value="View" > 
                        <Buttons> 
                            <telerik:RadToolBarButton Text="All Projects">                            
                            </telerik:RadToolBarButton> 
                            <telerik:RadToolBarButton IsSeparator="true" Value="Separator" /> 
                            <telerik:RadToolBarButton CssClass="logo" Value="SaveTemplate"
                                <ItemTemplate>            
                                    <div onclick="StopPropagation(event)">                  
                                         <table id="NewView" width="250px" style="margin-left:28px"
                                            <tr><td>View Name:</td><td><asp:TextBox ID="TextBoxViewName" runat="server" Width="150px" MaxLength="200" /></td></tr> 
                                            <tr><td>Is Default View:</td><td><asp:CheckBox ID="CheckBoxViewDefault" runat="server" /></td></tr> 
                                            <tr><td colspan="2" align="center"><asp:Button ID="ButtonCreateView" runat="server" Text="Save Template As View" OnClick="SaveTemplateAsView" /></td></tr> 
                                         </table>   
                                    </div>                                                  
                                </ItemTemplate> 
                            </telerik:RadToolBarButton> 
                        </Buttons> 
                    </telerik:RadToolBarSplitButton> 
                </Items> 
            </telerik:RadToolBar> 

    Thank you.
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 28 Aug 2009 Link to this post

    Hello Chad,

    I tested the provided code but couldn't observe this issue - the template is preserved after postback, only dynamically added templates should be added again on every postback.
    I've attached my test page for a reference.

    All the best,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Imran
    Imran avatar
    25 posts
    Member since:
    Mar 2009

    Posted 23 Nov 2009 Link to this post

    I am experiencing same problem. This started happening after Q3 update.

    Have there been any other reports indicating this issue?

    I have check boxes in the item template for rad tool bar buttons in rad drop down tool bar button.

    They were working fine previously but the Q3 release seems to have broken this.

    Please advise.

    Thanks
    Imran
  5. Imran
    Imran avatar
    25 posts
    Member since:
    Mar 2009

    Posted 24 Nov 2009 Link to this post

    Just a quick follow up on this.

    In my case I had split one toolbar into two.

    If first toolbar is not rendered by setting its visible property to flase, the second toolbar, works as expected.

    First toolbar is being used in conjunction with selecting columns to display in a radgrid and is rendered only to certain users so that they can change the layout of columns in grid and select which columns to show.

    Second tool bar has a drop down with multiple check boxes to enable the sorting, filtering, grouping etc. and is rendered to all users.

    The AJAX settings are render dynamically to ensure that they are not rendered for invisible toolbar.

    I had split them up so that I could hide the whole toolbar at once and not have to hide all buttons on the toolbar.

    For now I am going to take the quick route and put them back together since I can't figure out what could be causing the abnormal behaviour.

    One other note I enabled compression, though I think that should not cause any problems and I guess I could disable that to find out if that caused the controls to behave erratically, but due to shortage of time I am only going to combine the two toolbars back into one and hide buttons on the toolbar as per need.



  6. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 26 Nov 2009 Link to this post

    Hello Imran,

    I am sorry for the issues you're experiencing. Could you please send us a simple page where we could observe this problem? Thanks a lot

    Best wishes,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Imran
    Imran avatar
    25 posts
    Member since:
    Mar 2009

    Posted 26 Nov 2009 Link to this post

    Yana

    Thanks for the response I was able to resolve the issue.

    In addition to the dynamically rendered AJAX settings there was also static AJAX settings between the first toolbar and the second toolbar.

    This should not cause the second toolbar check boxes to disappear but strangely the column dropdown box in the first tool bar was causing the checkboxes to disappear from the second toolbar.

    Since the column selection dropdown does not need to make any changes to the checkboxes in the second toolbar I simply got rid of static AJAX settings between the two toolbars.

    That seems to have resolved the issue. Although I have no clue why that was happening, I still am happy to put it to rest.

    Imran
  8. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 27 Nov 2009 Link to this post

    Hello Imran,

    I'm glad you could find a solution. If you have any other issues, please contact us again.

    Best regards,
    Yana
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017