Home All Groups Group Topic Archive Search About

Question about IE Web Controls Toolbar.

Author
7 Jun 2005 9:36 PM
Ken Varn
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
-----------------------------------

Author
8 Jun 2005 1:23 AM
Alvin Bruney [MVP - ASP.NET]
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
Show quoteHide quote
"Ken Varn" <nospam> wrote in message
news:eX8AIk6aFHA.3328@TK2MSFTNGP09.phx.gbl...
>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
> -----------------------------------
>
>
Author
8 Jun 2005 12:15 PM
Ken Varn
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
-----------------------------------
Show quoteHide quote
"Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
news:%23PoOri8aFHA.2668@TK2MSFTNGP12.phx.gbl...
> 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:eX8AIk6aFHA.3328@TK2MSFTNGP09.phx.gbl...
> >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
> > -----------------------------------
> >
> >
>
>
Author
8 Jun 2005 11:57 PM
Alvin Bruney [MVP - ASP.NET]
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
Show quoteHide quote
"Ken Varn" <nospam> wrote in message
news:%23EMX1OCbFHA.3840@tk2msftngp13.phx.gbl...
> 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:%23PoOri8aFHA.2668@TK2MSFTNGP12.phx.gbl...
>> 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:eX8AIk6aFHA.3328@TK2MSFTNGP09.phx.gbl...
>> >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
>> > -----------------------------------
>> >
>> >
>>
>>
>
>
Author
9 Jun 2005 3:48 PM
Ken Varn
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
-----------------------------------
Show quoteHide quote
"Alvin Bruney [MVP - ASP.NET]" <www.lulu.com/owc> wrote in message
news:OSRbMcIbFHA.3848@TK2MSFTNGP10.phx.gbl...
> 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:%23EMX1OCbFHA.3840@tk2msftngp13.phx.gbl...
> > 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:%23PoOri8aFHA.2668@TK2MSFTNGP12.phx.gbl...
> >> 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:eX8AIk6aFHA.3328@TK2MSFTNGP09.phx.gbl...
> >> >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
> >> > -----------------------------------
> >> >
> >> >
> >>
> >>
> >
> >
>
>