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

[Bug] RadToolBarButton Selection Issue with Visible = false

10 Answers 184 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Kim Pollock
Top achievements
Rank 1
Kim Pollock asked on 05 May 2008, 06:04 PM
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

<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> 

10 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 06 May 2008, 08:07 AM
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
0
Kim Pollock
Top achievements
Rank 1
answered on 06 May 2008, 02:10 PM

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.
0
Erjan Gavalji
Telerik team
answered on 06 May 2008, 02:49 PM
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
0
Kim Pollock
Top achievements
Rank 1
answered on 06 May 2008, 03:20 PM
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
0
Erjan Gavalji
Telerik team
answered on 06 May 2008, 03:42 PM
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
0
Chris
Top achievements
Rank 1
answered on 08 Aug 2008, 01:38 PM
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.
0
Erjan Gavalji
Telerik team
answered on 08 Aug 2008, 02:05 PM
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.
0
Chris
Top achievements
Rank 1
answered on 25 Aug 2008, 04:16 PM
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
0
Erjan Gavalji
Telerik team
answered on 26 Aug 2008, 02:02 PM
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.
0
David
Top achievements
Rank 1
answered on 06 Nov 2008, 08:49 PM
Wassup Kim,

Looks like I'm missing it too...need some debug files. Did Controls fix work?
Tags
ToolBar
Asked by
Kim Pollock
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Kim Pollock
Top achievements
Rank 1
Chris
Top achievements
Rank 1
David
Top achievements
Rank 1
Share this question
or