[Bug] RadToolBarButton Selection Issue with Visible = false

11 posts, 0 answers
  1. Kim Pollock
    Kim Pollock avatar
    3 posts
    Member since:
    Aug 2007

    Posted 05 May 2008 Link to this post

    The following configured toolbar below looks like this:

    Yesterday | Current Week | LW | Last 4 Weeks | Last 13 Weeks

    When I programmatically hide "Yesterday" for certain reports and then lets say i click on LW button the next RadToolBarButton "Current Week" gets selected instead of one the I selected.  It seems like some kind of ordinal position problem.

    Thanks for your time,
    ~Kim

    1 <telerik:RadToolBar ID="ToolbarQuickLinks" runat="server" CausesValidation="False" OnButtonClick="ToolbarQuickLinks_ButtonClick" Skin="Office2007">  
    2     <CollapseAnimation Duration="200" Type="None" /> 
    3     <Items> 
    4         <telerik:RadToolBarButton runat="server" CheckOnClick="True" CommandArgument="Yesterday" 
    5             Text="Yesterday" Value="Yesterday" CausesValidation="False">  
    6         </telerik:RadToolBarButton> 
    7         <telerik:RadToolBarButton runat="server" CheckOnClick="True" CommandArgument="CurrentWeek" 
    8             Text="Current Week" Value="CurrentWeek" CausesValidation="False">  
    9         </telerik:RadToolBarButton> 
    10         <telerik:RadToolBarButton runat="server" CheckOnClick="True" CommandArgument="LW" 
    11             Text="LW" Value="LW" CausesValidation="False">  
    12         </telerik:RadToolBarButton> 
    13         <telerik:RadToolBarButton runat="server" CheckOnClick="True" Text="Last 4 Weeks" 
    14             CommandArgument="L4" Value="L4" CausesValidation="False">  
    15         </telerik:RadToolBarButton> 
    16         <telerik:RadToolBarButton runat="server" CheckOnClick="True" Text="Last 13 Weeks" 
    17             CommandArgument="L13" Value="L13" CausesValidation="False">  
    18         </telerik:RadToolBarButton> 
    19     </Items> 
    20     <ExpandAnimation Type="None" /> 
    21 </telerik:RadToolBar> 
  2. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 06 May 2008 Link to this post

    Hi Kim,

    It seems I'm missing something. Please, find attached a sample page I just created. Can you please complete it so that it demonstrates the problem?

    Note: You might need to open a formal support ticket to send an attachment, or you can just paste the changes hereby.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kim Pollock
    Kim Pollock avatar
    3 posts
    Member since:
    Aug 2007

    Posted 06 May 2008 Link to this post

    the following code below should reproduce the problem
    toolbar.aspx page

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="toolbar.aspx.vb" Inherits="toolbar" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title>Toolbar bug</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
            <div> 
                <telerik:RadScriptManager ID="sm" runat="server">  
                </telerik:RadScriptManager> 
                <telerik:RadStyleSheetManager ID="rssm" runat="server">  
                </telerik:RadStyleSheetManager> 
                <br /> 
                <asp:LinkButton ID="lbHideButton" runat="server">Hide Yesterday</asp:LinkButton><br /> 
                <br /> 
                <telerik:RadToolBar ID="ToolbarQuickLinks" runat="server" CausesValidation="False" 
                    OnButtonClick="ToolbarQuickLinks_ButtonClick" Skin="Office2007">  
                    <CollapseAnimation Duration="200" Type="None" /> 
                    <Items> 
                        <telerik:RadToolBarButton runat="server" CheckOnClick="True" CommandArgument="Yesterday" 
                            Text="Yesterday" Value="Yesterday" CausesValidation="False">  
                        </telerik:RadToolBarButton> 
                        <telerik:RadToolBarButton runat="server" CheckOnClick="True" CommandArgument="CurrentWeek" 
                            Text="Current Week" Value="CurrentWeek" CausesValidation="False">  
                        </telerik:RadToolBarButton> 
                        <telerik:RadToolBarButton runat="server" CheckOnClick="True" CommandArgument="LW" 
                            Text="LW" Value="LW" CausesValidation="False">  
                        </telerik:RadToolBarButton> 
                        <telerik:RadToolBarButton runat="server" CheckOnClick="True" Text="Last 4 Weeks" 
                            CommandArgument="L4" Value="L4" CausesValidation="False">  
                        </telerik:RadToolBarButton> 
                        <telerik:RadToolBarButton runat="server" CheckOnClick="True" Text="Last 13 Weeks" 
                            CommandArgument="L13" Value="L13" CausesValidation="False">  
                        </telerik:RadToolBarButton> 
                    </Items> 
                    <ExpandAnimation Type="None" /> 
                </telerik:RadToolBar> 
            </div> 
        </form> 
    </body> 
    </html> 

    code-behind page
    Partial Class toolbar  
        Inherits System.Web.UI.Page  
     
        Protected Sub ToolbarQuickLinks_ButtonClick(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadToolBarEventArgs) Handles ToolbarQuickLinks.ButtonClick  
     
        End Sub 
     
        Protected Sub lbHideButton_Click(ByVal sender As ObjectByVal e As System.EventArgs) Handles lbHideButton.Click  
            ToolbarQuickLinks.Items.FindItemByText("Yesterday").Visible = False 
        End Sub 
    End Class 

    to demo the problem click the hide button link then select one of the toolbar options.  *Note e.item.text shows the correct selected button but the graphic selected is incorrect.
  5. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 06 May 2008 Link to this post

    Hi Kim,

    Could it be that you're using RadControls "Prometheus" Futures version? I rechecked the page you sent me (attached for reference) and I did not have the problem with the official release of the RadControls ASP.NET for Ajax suite.

    Regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Kim Pollock
    Kim Pollock avatar
    3 posts
    Member since:
    Aug 2007

    Posted 06 May 2008 Link to this post

    I believe I installed the correct version.

    RadControls for ASPNET AJAX Q1 2008

    from my project bin dir Telerik.Web.UI.dll  version = 2008.1.415.20
  7. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 06 May 2008 Link to this post

    Hi Kim,

    I'm terribly sorry for the misunderstanding. I was hunting for the clicked button index on the server, but did not take care of the appearance. I'm sorry for that. We are working on fixing the bug. The fix will be available in the official service pack of the suite.

    Please, find your Telerik account updated.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Chris
    Chris avatar
    4 posts
    Member since:
    Oct 2007

    Posted 08 Aug 2008 Link to this post

    Has this issue been resolved?  I am having the same problem where hidden buttons being passed to the ButtonClick event handler because it they are determined based on their ordinal position.

    I did manage to get it to work if EnableViewState is true.  Unfortunately, there were problems with that setting when using 'RadControls for ASP.NET (Classic)', and I have not had a chance to see if the problem still exists as to whether or not leaving it true will be okay.
  9. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 08 Aug 2008 Link to this post

    Hi Chris,

    Yes, the bug was fixed. Please, give the latest version a try.

    By the way, can you please, give us some more details on why you turn the ViewState off? Clicking the visible toolbar buttons with disabled viewstate should not cause a problem too.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Chris
    Chris avatar
    4 posts
    Member since:
    Oct 2007

    Posted 25 Aug 2008 Link to this post

    Erjan:

    I am using the latest version of the controls, but I am still experiencing the problem.

    The reason I am unable to use ViewState for the toolbar is that problems arise when inserting buttons dynamically on the server-side.  Any template buttons created statically will disappear after a postback.

    Thank you,

    Chris
  11. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 26 Aug 2008 Link to this post

    Hi Chris,

    I just replied the other thread with a suggestion to modify the Controls collection of the templated buttons. I attached a small sample there.

    Let me know if it helps.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  12. David
    David avatar
    1 posts
    Member since:
    Nov 2008

    Posted 06 Nov 2008 Link to this post

    Wassup Kim,

    Looks like I'm missing it too...need some debug files. Did Controls fix work?
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017