|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Question about IE Web Controls Toolbar.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 ----------------------------------- 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 -- Show quoteHide quoteRegards, 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 > ----------------------------------- > > 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. -- Show quoteHide quote----------------------------------- 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 > > ----------------------------------- > > > > > > 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. -- Show quoteHide quoteRegards, 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 >> > ----------------------------------- >> > >> > >> >> > > 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. -- Show quoteHide quote----------------------------------- 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: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 > >> > ----------------------------------- > >> > > >> > > >> > >> > > > > > >
03 dropdownlist selectedindexchanged not firing in usercontrol on
Can assign multiple keys to datkeys of datagrid Displaying label at runtime MasterPages in ASP.NET 2.0 Need a list of radiobuttons with a specfic format Gridview, using Callbacks when Sorting and Paging textbox postback Div and code behind on click event image showing blurred text on "forgot my password" pages? Infragistics Mousedown event is not happening |
|||||||||||||||||||||||