hi im new in NetAdvantage and i was looking but i didnt find the answer.
Q: how can i add a DateTimePicker to a to a ribbon??? i try some like this
UltraToolbarsManager1.Ribbon.Tabs(0).Groups(0).Tools.AddTool(
New DateTimePicker())
Hello,
The following article from Infragistics's online documentation should help get you pointed in the right direction:
<http://help.infragistics.com/Help/NetAdvantage/WinForms/2009.1/CLR2.0/html/WinToolbarsManager_Add_a_Tool_to_a_Ribbon_Group.html>
i jason, tnx for your time and help.
but ... i read the article before asking and i didnt help me, the fact is that this article show how to add controls but this.ultraToolbarsManager1.Tools.Add does not accept DateTimePicker's.
i tryed many ways but nothing works, i hope you can help. the problem is that "Tools.Add" just accept "baseTool" types
You'll need to use a ControlContainerTool and set its Control property to that of your DateTimePicker. I've modified the code that was provided in that link to demonstrate how you would do this:
Dim homeTab As New RibbonTab("Home") Me.UltraToolbarsManager1.Ribbon.Tabs.Add(homeTab)
Dim dateGroup As New RibbonGroup("Date") Me.UltraToolbarsManager1.Ribbon.Tabs("Home").Groups.Add(dateGroup)
Dim container As New ControlContainerTool("dateContainer") Dim datePicker As New DateTimePicker()
container.Control = datePicker
Me.UltraToolbarsManager1.Tools.Add(container) dateGroup.Tools.AddTool(container.Key, False)
fantastic, that worked! :) i was trying a lot of ways and read documentation of infragistics and google but a did not get the answer.
fortunately your code works perfect. this is my implementation if the tabs and groups already exists
Dim container As New Infragistics.Win.UltraWinToolbars.ControlContainerTool("dateContainer") Dim datePicker As New DateTimePicker() container.Control = datePicker
Me.UltraToolbarsManager1.Tools.Add(container) Me.UltraToolbarsManager1.Ribbon.Tabs(0).Groups(2).Tools.AddTool(container.Key, False)