| <telerik:RadComboBox |
| Id="SearchCombo" |
| Runat="server" |
| EnableLoadOnDemand="True" |
| OnItemsRequested="SearchCombo_ItemsRequested" |
| LoadingMessage="Searching..." |
| EmptyMessage="Search ..." |
| Height="15px" |
| Width="315px" |
| DropDownWidth="400px" |
| Skin="Sunset" |
| OnSelectedIndexChanged="SearchCombo_SelectedIndexChanged" |
| OnClientItemsRequesting="HandleRequestStart" |
| OnClientKeyPressing="HandleKeyPress" |
| BackColor="#E0E0E0" |
| BorderColor="Transparent" |
| CollapseDelay="200" |
| ExpandDelay="300" |
| ItemRequestTimeout="200" |
| ShowDropDownOnTextboxClick="False" |
| ShowWhileLoading="False" |
| AutoPostBack="true" |
| ShowToggleImage="False" |
| ShowMoreResultsBox="True" |
| CausesValidation="False" |
| OnClientItemsRequested="HandleRequestEnd" |
| HighlightTemplatedItems="True"> |
| <ItemTemplate> |
| <div class="AssocSearchItemContainer" > |
| <div style=" float:left;"> |
| <img alt='<%# Eval("Title")%>' height="40px" src='<%# Eval("ThumbnailURL")%>' /> |
| </div> |
| <div class="AssocSearchItemTextBlock"> |
| <strong><%# Eval("Title")%></strong><br /> |
| <%# Eval("Description")%><br /> |
| <%# Eval("Details")%><br /> |
| </div> |
| </div> |
| </ItemTemplate> |
| <CollapseAnimation Duration="100" Type="OutQuint" /> |
| <ExpandAnimation Type="None" /> |
| </telerik:RadComboBox> |
Hello,
We have a problem with RadTreeView with Context Menus running in the PanelBar. Every time menu gets repainted (right mouse click, etc.) we are getting a JavaScript error. The same tree with the same menus running outside the PadPanelBar functions fine. The Context Menus both populated in runtime and static – the same behavior.
Details:
Version: .NET 3.5 ; Telerik ASP.NET controls for 3.5 (2008.1.619.35)
The error is in the code (js):
Telerik.Web.UI.RadMenu._getMaxRootItemWidth=function(_43){
var _44=Telerik.Web.UI.RadMenu._getChildListElement(_43);
var _45=_44.childNodes; ß-this line, 'childNodes' is null or not an object
_43- is a Context Menu element, at the time of the error it is empty, though after you ignore the errors (there can be a number of them ,all the same) the context menu displays just fine.
_44 is null
Some call stack details (not every call stack element, just those seem important)
Called from: var _3e=Telerik.Web.UI.RadMenu._getMaxRootItemWidth(_3d);
Called from: if(this._flow==Telerik.Web.UI.ItemFlow.Vertical){
Telerik.Web.UI.RadMenu._adjustRootItemWidth(this.get_id());
} –tried to set Flow=”Horizontal” in the menu or in the DefaultSettingsGroup- didn’t help
Called from: _7.repaint();
Called from: $telerik.repaintChildren(this); where “this” is a PanelBar – this.element.id= ctl00_ContentPlaceHolder1_rpbNav
Called from: this.get_panelBar()._callRadShow();
Called from:
if (!initialLoad) {
// If this isn't the first page load (i.e. we are doing an async postback), we
// need to re-raise the Application's load event.
Sys.Application.raiseLoad();
}, which is in MicrosoftAjaxWebForms.js
Looks like the conext menu gets interrogated by repaint from RadPanleBar before it gets populated.
Part of .ASPX page (it is a content page within master page):
<telerik:RadPanelItem runat="server" Text="Farm Hierarchy"
Width="100%" Value="FarmHierarchy" Expanded="true" >
<Items>
<telerik:RadPanelItem runat="server" Value="FarmHierarchyBody" >
<ItemTemplate>
<asp:UpdatePanel ID="upMenu" runat="server" ChildrenAsTriggers="False" UpdateMode="Conditional">
<ContentTemplate>
<cc2:xcPanel ID="pnlFarmTree" runat="server" Width="100%" CssClass="PanelNoBorder" meta:resourcekey="pnlFarmTreeResource1">
<cc2:xcTreeView ID="trMenu" runat="server" CssClass="TreeView" PersistLoadOnDemandNodes="true" Height="400px"
NodeIndent="15"
onnodeexpand="trMenu_TreeNodePopulate" ShowLines="True" Style="border-top-style: none;
border-right-style: none; border-left-style: none; border-bottom-style: none" Skin="Sunset" MultipleSelect="true"
Width="100%" meta:resourcekey="trMenuResource1" onnodeclick="tree_NodeClick" SingleExpandPath="false" OnContextMenuItemClick="tree_ContextClicked" onClientContextMenuShown="ClientContextMenuShown"
>
<ContextMenus>
<telerik:RadTreeViewContextMenu Skin="Outlook" ID="EmptyMenu" runat="server" Width="30px" >
<defaultgroupsettings flow="Horizontal" />
<Items>
<telerik:RadMenuItem IsSeparator="true"></telerik:RadMenuItem>
</Items>
</telerik:RadTreeViewContextMenu>
<telerik:RadTreeViewContextMenu Skin="Outlook" Font-Size="8pt" ID="FARMCMenu" runat="server">
<defaultgroupsettings flow="Horizontal" />
<Items>
</Items>
</telerik:RadTreeViewContextMenu>
<telerik:RadTreeViewContextMenu Skin="Outlook" Font-Size="8pt" ID="WAPCMenu" runat="server">
<defaultgroupsettings flow="Horizontal" />
<Items>
</Items>
</telerik:RadTreeViewContextMenu>
<telerik:RadTreeViewContextMenu Skin="Outlook" Font-Size="8pt" ID="SITECMenu" runat="server" flow="Horizontal">
<defaultgroupsettings flow="Horizontal" />
<Items>
</Items>
</telerik:RadTreeViewContextMenu>
<telerik:RadTreeViewContextMenu Skin="Outlook" Font-Size="8pt" ID="WEBCMenu" runat="server">
<defaultgroupsettings flow="Horizontal" />
<Items>
</Items>
</telerik:RadTreeViewContextMenu>
<telerik:RadTreeViewContextMenu Skin="Outlook" Font-Size="8pt" ID="GROUPCMenu" runat="server">
<defaultgroupsettings flow="Horizontal" />
<Items>
</Items>
</telerik:RadTreeViewContextMenu>
</ContextMenus>
</cc2:xcTreeView>
</cc2:xcPanel>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</telerik:RadPanelItem>
</Items>
</telerik:RadPanelItem>
For this particular page menus are populated dynamically, although we have the same problem in another tree with a static context menu.
Please help. Our release is closing and we really like the functionality of the PanelBar and would like to include it into the released version.
Thanks a lot,
Irene Troupansky
| function EditAct(sender, eventArgs) { |
| var grid = sender; |
| var MasterTable = grid.get_masterTableView(); |
| var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()]; |
| alert(row.getDataKeyValue('Act_No')); |
| } |
<ClientEvents OnRowDblClick="EditAct" />
any assistance would be appreciated, thanks!
//Resource site = apt.Owner.Resources.GetResource("Site", ????);
Here is my code if anybody can help I could move n with my 2 day hang up.
Default.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
RadScheduler1.GroupBy = "Site";
}
Provived Code
public override IEnumerable<Appointment> GetAppointments(RadScheduler owner)
{
List<Appointment> appointments = new List<Appointment>();
//Code removed for security, This is how I get my dataset
DB.m_da = das;
DataSet ds = new DataSet("Patients");
DB.m_da.SetRead("[pWebApptsDay]", 0);
SqlParameter pday = new SqlParameter("@day", System.Data.SqlDbType.VarChar);
pday.Value = DateTime.Today;
DateTime dt = DateTime.Today;
DB.m_da.AddParam(pday);
DB.m_da.Run(ref ds);
System.Data.DataRow[] rows = ds.Tables[0].Select(null, null, System.Data.DataViewRowState.CurrentRows);
foreach (DataRow row in rows)
{
Appointment apt = new Appointment();
apt.Owner = owner;
DateTime st = new DateTime();
DateTime et = new DateTime();
st = (DateTime)(row.ItemArray.GetValue(2));
et = st.AddMinutes((int)row.ItemArray.GetValue(3));
System.Drawing.Color color = ColorTranslator.FromWin32((int)row.ItemArray.GetValue(4));
//trap for bad data IE Nulls
if (String.IsNullOrEmpty(row.ItemArray.GetValue(5).ToString()))
apt.Subject = "Bad Appointment Data Contact Tims Support Appointment id =" + row.ItemArray.GetValue(0).ToString();
else
apt.ID = row.ItemArray.GetValue(0).ToString();
apt.Subject = (String)row.ItemArray.GetValue(5);
apt.Start = Convert.ToDateTime(((DateTime)row.ItemArray.GetValue(2)).ToShortDateString() +
" " + ((DateTime)row.ItemArray.GetValue(2)).ToShortTimeString());
apt.End = (apt.Start.AddMinutes((int)row.ItemArray.GetValue(3)));
apt.BorderColor = color;
LoadResources(apt);
//Resource site = apt.Owner.Resources.GetResource("Site", ????);
apt.Resources.Add(site);
appointments.Add(apt);
}
return appointments;
}
public override void Insert(RadScheduler owner, Appointment appointmentToInsert)
{
}
public override void Update(RadScheduler owner, Appointment appointmentToUpdate)
{
}
public override void Delete(RadScheduler owner, Appointment appointmentToDelete)
{
}
public override IEnumerable<ResourceType> GetResourceTypes(RadScheduler owner)
{
ResourceType[] resourceTypes = new ResourceType[3];
resourceTypes[0] = new ResourceType("Site", true);
resourceTypes[1] = new ResourceType("Provider", true);
resourceTypes[2] = new ResourceType("Resource", true);
return resourceTypes;
}
public override IEnumerable<Resource> GetResourcesByType(RadScheduler owner, string resourceType)
{
switch (resourceType)
{
case "Site":
return GetSite();
case "Provider":
return GetProvider();
case "Resource":
return GetResource();
default:
throw new InvalidOperationException("Unknown resource type: " + resourceType);
}
}
private IEnumerable<Resource> GetSite()
{
List<Resource> resources = new List<Resource>();
//Code removed for security, This is how I get my dataset
DB.m_da = das;
DataSet ds = new DataSet("Resources");
DB.m_da.SetRead("[pWebApptResourceFetch]", 0);
SqlParameter type = new SqlParameter("@ResourceType", System.Data.SqlDbType.VarChar);
type.Value = "Site";
DB.m_da.AddParam(type);
DB.m_da.Run(ref ds);
System.Data.DataRow[] rows = ds.Tables[0].Select(null, null, System.Data.DataViewRowState.CurrentRows);
foreach (DataRow row in rows)
{
Resource res = new Resource();
res.Type = "Site";
res.Key = row.ItemArray.GetValue(0).ToString();
res.Text = row.ItemArray.GetValue(1).ToString(); ;
//res.Attributes["Phone"] = Convert.ToString(reader["Phone"]);
resources.Add(res);
}
return resources;
}
Thanks for any help :)