Question about IE Web Controls Toolbar.

K

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

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
-----------------------------------
Alvin Bruney said:
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
 
K

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
-----------------------------------
Alvin Bruney said:
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 said:
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 said:
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
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top