Question about IE Web Controls Toolbar.

Discussion in 'ASP .Net Web Controls' started by Ken Varn, Jun 7, 2005.

  1. Ken Varn

    Ken Varn Guest

    I am using the IE Web Controls Toolbar. One of the toolbar items I am using
    is a ToolbarDropDownList. I have set AutoPostback to true for the
    ToolbarDropDownList. The page does a postback as expected when the
    selection is changed, but I cannot figure out which event to trap in order
    to process the selection. Also, I can't even figure out how to get the
    selected item from the drop down list. I have tried calling FindControl()
    on the Toolbar instance, but it returns null.

    So... two questions:

    1. What event should I check for when the ToolbarDropDownList selection
    changes?
    2. How do I get the ToolbarDropDownList selected item?


    --
    -----------------------------------
    Ken Varn
    Senior Software Engineer
    Diebold Inc.

    EmailID = varnk
    Domain = Diebold.com
    -----------------------------------
     
    Ken Varn, Jun 7, 2005
    #1
    1. Advertising

  2. Ken Varn

    Ken Varn Guest

    That works fine for buttons on the toolbar, but the ButtonClick event does
    not get fired for a ToolbarDropDownList when the selected item is changed.
    Please read the original post.

    --
    -----------------------------------
    Ken Varn
    Senior Software Engineer
    Diebold Inc.

    EmailID = varnk
    Domain = Diebold.com
    -----------------------------------
    "Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
    news:%...
    > here is some code
    >
    > private void Tools_ButtonClick(object sender, System.EventArgs e)
    >
    > {
    >
    > if (sender.GetType().ToString() ==
    > "Microsoft.Web.UI.WebControls.ToolbarButton")
    >
    > {
    >
    > EnableToolBarButtons();
    >
    > string strBtnName = "";
    >
    > Widget.ToolbarButton oButton= (Widget.ToolbarButton)sender;
    >
    > strBtnName = oButton.Text;
    >
    >
    > if(oButton.Text.IndexOf("Add Record") > -1) ....
    >
    > you get the idea
    >
    >
    > --
    > Regards,
    > Alvin Bruney - ASP.NET MVP
    >
    > [Shameless Author Plug]
    > The Microsoft Office Web Components Black Book with .NET
    > Now available @ www.lulu.com/owc, Amazon.com etc
    > "Ken Varn" <nospam> wrote in message
    > news:...
    > >I am using the IE Web Controls Toolbar. One of the toolbar items I am
    > >using
    > > is a ToolbarDropDownList. I have set AutoPostback to true for the
    > > ToolbarDropDownList. The page does a postback as expected when the
    > > selection is changed, but I cannot figure out which event to trap in

    order
    > > to process the selection. Also, I can't even figure out how to get the
    > > selected item from the drop down list. I have tried calling

    FindControl()
    > > on the Toolbar instance, but it returns null.
    > >
    > > So... two questions:
    > >
    > > 1. What event should I check for when the ToolbarDropDownList selection
    > > changes?
    > > 2. How do I get the ToolbarDropDownList selected item?
    > >
    > >
    > > --
    > > -----------------------------------
    > > Ken Varn
    > > Senior Software Engineer
    > > Diebold Inc.
    > >
    > > EmailID = varnk
    > > Domain = Diebold.com
    > > -----------------------------------
    > >
    > >

    >
    >
     
    Ken Varn, Jun 8, 2005
    #2
    1. Advertising

  3. Ken Varn

    Ken Varn Guest

    I am using the designer to add the ToolbarDropDownList item. There does not
    seem to be a way to access the item events in toolbar items using the
    designer.

    I finally did what you described and wired up the event manually and it
    seemed to work.


    --
    -----------------------------------
    Ken Varn
    Senior Software Engineer
    Diebold Inc.

    EmailID = varnk
    Domain = Diebold.com
    -----------------------------------
    "Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
    news:...
    > How are you adding the toolbar buttons? If you are using the designer it
    > should fire the itemcommand event (if memory serves me correctly). If you
    > are adding it dynamically, then you will need to manually wire up the
    > events. An alternative way is to manually wire the toolbardropdownlist
    > explicitly in the page_load event handler.
    >
    > --
    > Regards,
    > Alvin Bruney - ASP.NET MVP
    >
    > [Shameless Author Plug]
    > The Microsoft Office Web Components Black Book with .NET
    > Now available @ www.lulu.com/owc, Amazon.com etc
    > "Ken Varn" <nospam> wrote in message
    > news:%...
    > > That works fine for buttons on the toolbar, but the ButtonClick event

    does
    > > not get fired for a ToolbarDropDownList when the selected item is

    changed.
    > > Please read the original post.
    > >
    > > --
    > > -----------------------------------
    > > Ken Varn
    > > Senior Software Engineer
    > > Diebold Inc.
    > >
    > > EmailID = varnk
    > > Domain = Diebold.com
    > > -----------------------------------
    > > "Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
    > > news:%...
    > >> here is some code
    > >>
    > >> private void Tools_ButtonClick(object sender, System.EventArgs e)
    > >>
    > >> {
    > >>
    > >> if (sender.GetType().ToString() ==
    > >> "Microsoft.Web.UI.WebControls.ToolbarButton")
    > >>
    > >> {
    > >>
    > >> EnableToolBarButtons();
    > >>
    > >> string strBtnName = "";
    > >>
    > >> Widget.ToolbarButton oButton= (Widget.ToolbarButton)sender;
    > >>
    > >> strBtnName = oButton.Text;
    > >>
    > >>
    > >> if(oButton.Text.IndexOf("Add Record") > -1) ....
    > >>
    > >> you get the idea
    > >>
    > >>
    > >> --
    > >> Regards,
    > >> Alvin Bruney - ASP.NET MVP
    > >>
    > >> [Shameless Author Plug]
    > >> The Microsoft Office Web Components Black Book with .NET
    > >> Now available @ www.lulu.com/owc, Amazon.com etc
    > >> "Ken Varn" <nospam> wrote in message
    > >> news:...
    > >> >I am using the IE Web Controls Toolbar. One of the toolbar items I am
    > >> >using
    > >> > is a ToolbarDropDownList. I have set AutoPostback to true for the
    > >> > ToolbarDropDownList. The page does a postback as expected when the
    > >> > selection is changed, but I cannot figure out which event to trap in

    > > order
    > >> > to process the selection. Also, I can't even figure out how to get

    the
    > >> > selected item from the drop down list. I have tried calling

    > > FindControl()
    > >> > on the Toolbar instance, but it returns null.
    > >> >
    > >> > So... two questions:
    > >> >
    > >> > 1. What event should I check for when the ToolbarDropDownList
    > >> > selection
    > >> > changes?
    > >> > 2. How do I get the ToolbarDropDownList selected item?
    > >> >
    > >> >
    > >> > --
    > >> > -----------------------------------
    > >> > Ken Varn
    > >> > Senior Software Engineer
    > >> > Diebold Inc.
    > >> >
    > >> > EmailID = varnk
    > >> > Domain = Diebold.com
    > >> > -----------------------------------
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >

    >
    >
     
    Ken Varn, Jun 9, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kojikabutosv
    Replies:
    0
    Views:
    333
    kojikabutosv
    Aug 13, 2008
  2. Aidan Gill

    Installing Web Controls on the toolbar

    Aidan Gill, Jul 9, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    147
    J P Deka
    Jul 9, 2003
  3. Olivier HAULT

    MSDN Managed Newsgroups ASP.NET Controls for Toolbar, Menu, etc

    Olivier HAULT, Jun 23, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    164
    Olivier HAULT
    Jun 23, 2004
  4. Earl Teigrob

    Setting Attribute so some controls will not show in ToolBar?

    Earl Teigrob, Sep 23, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    105
    Robert Koritnik
    Sep 23, 2004
  5. pcouas
    Replies:
    0
    Views:
    284
    pcouas
    Feb 19, 2007
Loading...

Share This Page