Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Webtoolbar's customrules not working
posted

I have a situation with ultrwebtoolbar's customrules. In my web form, I have to add 16 jquery enabled Calender or datepicker controls. Some of the buttons defined in ultrawebtoolbar's are suppose to be hidden and defined as  btn.DefaultStyle.CustomRules = "DISPLAY: none". It does work perfectly as long as the # of datepicker controls  are 15. As soon as I add next picker making it 16th datepicker control, then customrules seems not working displaying all the button defined. So example would be, it is suppose to hide , 'Approval', 'Duplicate' buttons. And it does work, however, as soon as I add extra date picker control making it 16th control, then it display all of the button including 'Approval', 'Duplicate' buttons. It is only happening in IE(I am using 9.0).

Anybody could enlighten me.

I would appreciate it.

Parents Reply Children
  • 135
    posted in reply to [Infragistics] Nikolay

    I have decide to post a simple form that I created to test it,  run this one  and look for the tool bar. Then add extra calender and run it the tool bar look different
    there are about 28 jquery calenders defined in scriptcontrols assembly. if you run this page the tool control work as it is define. As soon as you add next calender then you will see all the button defined in ucToolbar.ascx. I hope this will help to look into the issue
    <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="csg.mis.crforms.WebForm1" %>
    <%@ Register TagPrefix="uc1" TagName="ucToolbar" Src="../UserControls/ucToolbar.ascx" %>
    <%@ Register Assembly="csg.mis.common.ScriptControls" namespace="csg.mis.common.ScriptControls" tagprefix="ScriptControls" %>
    <!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></title>
    <script type="text/javascript" src="/mis/scripts/jquery-1.5.1.min.js"></script>
    </head>
    <body>
    <form id="form1" runat="server">
    <uc1:uctoolbar id="ToolBar" runat="server"></uc1:uctoolbar>
    <ScriptControls:Calendar ID="txtProjStartDate" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate0" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate1" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate2" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate3" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate4" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate5" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate6" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate7" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate8" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate9" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate10" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate11" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate12" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate13" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate14" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate15" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate16" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate17" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate18" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate19" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate20" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate21" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate22" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate23" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate24" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate25" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate26" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate27" runat="server" CssClass="formInputBoxText" />
    <ScriptControls:Calendar ID="txtProjStartDate28" runat="server" CssClass="formInputBoxText" />
    </form>
    </body>
    </html>

    On code behind all I have is

    Public Class WebForm1
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    ToolBar.HideButtons(New String() {"Cancel", "Approve", "RtntoDraft", "Exit"})
    End Sub
    End Class

     

    in user control HideButtons is defined as

    '<summary>

    ' Remove buttons from an infragistics toolbar.

    ' pass in the toolbar and a string array of button keys to be removed.

    '</summary>

    Public Sub HideButtons(ByVal keys() As String)

    Dim btn As TBarButton

    Dim key As String

    For Each key In keys

    btn = _toolbar.Items.FromKeyButton(key)

    If Not IsNothing(btn) Then

    btn.DefaultStyle.CustomRules = "DISPLAY: none"

    End If

    Next

    End Sub
     
    the webtoolbar is defined as follow
    <%@ Control Language="vb" AutoEventWireup="false" Codebehind="ucToolbar.ascx.vb" Inherits="csg.mis.crforms.ucToolbar" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

    <%@ Register Assembly="Infragistics4.WebUI.UltraWebToolbar.v10.3, Version=10.3.20103.2088, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" Namespace="Infragistics.WebUI.UltraWebToolbar" TagPrefix="igtbar" %>

     

    <igtbar:ultrawebtoolbar id="_toolbar" CssClass="NoPrint" runat="server" Width="669px" borderstyle="None"

    backcolor="White" Font-Names="Arial" Font-Size="9pt" Height="24px" BackgroundImage="/ig_common/webtoolbar2/blueexplorer.gif"

    MovableImage="/ig_common/webtoolbar2/ig_tb_move03.gif" ItemWidthDefault="93px" ItemSpacing="0">

    <HoverStyle Cursor="Default" borderwidth="1px" BorderColor="Navy" borderstyle="Solid"

    backcolor="DarkOrange" TextAlign="Left"></HoverStyle>

    <ClientSideEvents Click="ToolBar_Click"></ClientSideEvents>

    <SelectedStyle Cursor="Default" borderwidth="1px" BorderColor="Navy" borderstyle="Solid"


    backcolor="Gainsboro" TextAlign="Left"></SelectedStyle>

    <Items>

    <igtbar:TBarButton Key="Save" ToolTip="Save this Request" Text="Save" Image="/images/common/save.gif"></igtbar:TBarButton>

    <igtbar:TBarButton Key="SaveandExit" ToolTip="Save this Request and Exit" Text="Save &amp; Exit" Image="/images/common/save.gif"></igtbar:TBarButton>

    <igtbar:TBarButton Key="Cancel" ToolTip="Set the status of this Request to cancelled" Text="Cancel"

    Image="/images/common/cancel.gif"></igtbar:TBarButton>

    <igtbar:TBarButton Key="Submit" ToolTip="Submit this Request and commence workflow" Text="Submit" Image="/images/common/ok.gif"></igtbar:TBarButton>

    <igtbar:TBarButton Key="Approve" ToolTip="Approve this request" Text="Approve" Image="/images/common/Approve.gif"></igtbar:TBarButton>

    <igtbar:TBarButton Key="RtntoDraft" ToolTip="Return this Request to draft" Text="Rtn to Draft" Image="/images/common/negative.gif"></igtbar:TBarButton>

    <igtbar:TBarButton Key="Send" ToolTip="Opens your mail client to send a link to this Request" Text="Send"

    Image="/images/common/mail.gif"></igtbar:TBarButton>

    <igtbar:TBarButton Key="Duplicate" Text="Duplicate" Image="/images/common/copy.gif">

    <DefaultStyle CustomRules="DISPLAY: none"></DefaultStyle>

    </igtbar:TBarButton>

    <igtbar:TBarButton Key="Print" ToolTip="Print Preview" Text="Print" Image="/images/common/print.gif">

    <DefaultStyle CustomRules="DISPLAY: none"></DefaultStyle>

    </igtbar:TBarButton>

    </Items>

    <DefaultStyle borderwidth="0px" BorderColor="Menu" borderstyle="Solid" BackgroundImage="/ig_common/webtoolbar2/blueexplorer.gif"

    TextAlign="Left"></DefaultStyle>

    </igtbar:ultrawebtoolbar>