The replacement for the retiring ultrawebtoolbar is the webdatamenu but I can't find any samples or examples or any information about how to achieve this. I have a very simple toolbar with two dropdownlists and a button. Do you have any suggestions as to how I can create a menu with these controls embedded and be able to access the controls in the code behind. I tried creating templates but then couldn't see them in the code behind. I don't know whether the templates need to be created using a class (as in the webdatagrid templated columns) or whether to access the control using findcontrol (as in the webexplorer). Is there any migration documentation to indicate how this can be achieved?
Thanks
Andy
BTW I love the term 'sunset policy'...
Hi Andy,
Please let me know if you need further assistance with this issue.
The developer says you can create your own template and add controls to it as you desire with the following code:
If you have any other questions about this matter, please feel free to ask.
Hello Andy,
For your first issue with retreiving the object, $find is probably returning null because the WebDataMenu isn't instantiated on the client when your function is called. AJAX controls are initialized after the page is loaded, so you would need to wait until later in the page's life-cycle to obtain it.
If possible for you, I recommend using the WebDataMenu's client side Initialize event to call your function and using $find("<%= WebDataMenu1.ClientID %>") should return the correct object.
As for adding the controls to the template, that code looks fine. I tried the same code, and was able to reproduce the issue. I'll need to look into it a little bit further and should have an answer for you by the end of Friday.
If you have any further questions or concerns, please let me know and I'll be glad to help.
My existing application creates the controls in code and add them to the toolbar so I want to create the controls and add them to the templates:
chkShowDescendantRecords = New CheckBox With chkShowDescendantRecords .AutoPostBack = True .CssClass = CssClass.ToolBarCheckBox .ID = "chkShowDescendantRecords" .Text = "Show Descendant Records" .LabelAttributes.Add("hideFocus", "true") .Checked = GetSessionBoolean(SessionVariable.ExplorerShowDescendants) End With WebDataMenu1.Templates.Item(0).Controls.Add(chkShowDescendantRecords)
The code runs ok but the checkbox control does not appear in the webdatamenu.
Is there away to get this to work?
Upgrading an ultrawebtoolbar to the webdatamenu, what is the equivalent function to igtbar_getToolbarById in javascript to get the webdatamenu object? I have tried document.getElementById("WebDataMenu1") which gets the elment but $find returns a null.
function enableToolbarButton(sKey, bEnabled) { var oToolbar = igtbar_getToolbarById("uwtUltraWebToolBar"); var oButton = oToolbar.Items.fromKey(sKey); if (oButton != null) { oButton.setEnabled(bEnabled); }}