Hi,
I'm trying to use a Hierarchical DataSource of domain objects with the RadTreeView control.
I've set the DataSource, DataMember, DataTextField, and DataValueField in the markup on my ASPX page for the RadTreeView control...
However, it does not appear that the RadTreeView control is using the "DataMember" field to access a particular property of the Hierarchy Data Object that I want to use.
After taking a look at the stack trace here:
[HttpException (0x80004005): DataBinding: ******.UI.WebControls.DomainObjectHierarchyData' does not contain a property with the name 'Name'.] System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName) +197 System.Web.UI.DataBinder.GetPropertyValue(Object container, String propName, String format) +11 Telerik.Web.UI.ControlItem.PopulateFromDataItem(PropertyDescriptorCollection properties, Object dataItem, String dataMember, Int32 depth) +215 Telerik.Web.UI.NavigationItem.PopulateFromDataItem(PropertyDescriptorCollection properties, Object dataItem, String dataMember, Int32 depth) +76 Telerik.Web.UI.RadTreeNode.PopulateFromDataItem(PropertyDescriptorCollection properties, Object dataItem, String dataMember, Int32 depth) +64 Telerik.Web.UI.ControlDataBinder.SetItemPropeties(ControlItem item, Object dataItem, String dataMember, Int32 depth) +73 Telerik.Web.UI.ControlDataBinder.BindItem(ControlItemCollection items, Object dataObject, Object dataItem, String dataMember, Int32 depth) +92
....
I looked at Telerik.Web.UI.ControlItem.PopulateFromDataItem() method and I noticed that the ControlItem.PopulateFromDataItem() does not respect the "dataMember" parameter that is being passed in.
Is this a limitation of the "Beta" "Prometheus" RadControls?
Thanks,
Brian
<script type="text/javascript">The dialog contains two buttons - "Yes" and "No". Both of them are doing a server postback. "No" should just close the dialog while "Yes" sould to some server-side action, close the dialog and refresh the parent page.
function openRadWindow(VoterID, EventID)
{
var oWnd = radopen("DialogVoterDelete.aspx?voterid=" + VoterID + "&eventid=" + EventID, "TrashConfirmWindow" );
oWnd.Center();
}
</script>
<script type="text/javascript">In the dialog.aspx I inserted a literal named "InjectScript" with the "passthrough" option set. On the server-side (C#) I've implemented the two methods below:
//This code is used to provide a reference to the radwindow "wrapper"
function GetRadWindow()
{
var oWindow = null;
if (window.RadWindow1) oWindow = window.RadWindow1; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.RadWindow1) oWindow = window.frameElement.RadWindow1;//IE (and Moz az well)
return oWindow;
}
function CloseOnReload()
{
GetRadWindow().close();
}
function RefreshParentPage()
{
GetRadWindow().BrowserWindow.location.reload();
}
</script>
private void CloseDialogOnRefresh()These two functions where called from the server-side Click-Handlers but none of them works. Both results in a JScript error for some Null-References within the dialog.aspx.
{
InjectScript.Text = "<script>CloseOnReload()</script>";
}
private void RefreshParentPage()
{
InjectScript.Text = "<script>RefreshParentPage()</script>";
}
protected void RadGridSpecialty_ItemDataBound1(object sender, GridItemEventArgs e)
{
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
GridEditManager editMan = editedItem.EditManager;
GridDropDownColumnEditor editor = editMan.GetColumnEditor("ddlGridSepcialty") as GridDropDownColumnEditor;
//// My logic not related to Error
strSelect =
"select SpecialtyID, SpecialtyName from sl_Specialty where SpecialtyID NOT IN (1,3)";
DataSet dst = new DataSet();
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand cnn = new SqlCommand(strSelect, con);
SqlDataAdapter adp = new SqlDataAdapter(cnn);
adp.Fill(dst);
editor.DataSource = dst.Tables[0];
editor.DataBind();
}
}
| <%@ Page Language="VB" AutoEventWireup="false" CodeFile="prize2.aspx.vb" Inherits="prize2" %> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <html xmlns="http://www.w3.org/1999/xhtml"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <head runat="server"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <title>AtHomeNet - Prizes</title> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </head> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <body> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <script type="text/javascript"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //This code is used to provide a reference to the radwindow "wrapper" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function GetRadWindow() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var oWindow = null; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (window.radWindow) oWindow = window.radWindow; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return oWindow; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| function OK_Clicked() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var oWindow = GetRadWindow(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| //Get current content of text area | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var arg = new Object(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arg.NameValue = document.getElementById("txtItemNumber").value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| oWindow.Close(arg); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </script> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <form id="form1" runat="server"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <textarea runat="server" id="txtItemNumber" visible="false" rows="1" cols="38"></textarea> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <asp:DataList id='DataList1' BorderColor="black" CellPadding="0" Font-Names="Verdana" Font-Size="8pt" AlternatingItemStyle-BackColor="#FFFFFF" runat="server"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ItemStyle BackColor="White"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </ItemStyle> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <ItemTemplate> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <asp:Image ID="Image1" runat="server" ImageUrl="http://www.bondware.com/mod/bcs/photos/Thumb11.gif" /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <table border="0" cellpadding="0" cellspacing="0"> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <tr> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <td width="10"> </td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <td class="clsCaption" width="350"><b><%#Eval("PrizeTitle")%></b></td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </tr> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <tr> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <td width="10"> </td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <td class="clsCaption" width="350"><%#Eval("PrizeDescription")%> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <br /><br /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <asp:LinkButton ID="LinkButton1" OnClientClick='OK_Clicked' CommandName="SelectPrize" CommandArgument='<%#Eval("ItemNumber") %>' runat="server">Choose as prize</asp:LinkButton> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <br /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <asp:HyperLink ID="HyperLink1" NavigateUrl="#" runat="server">Buy now!</asp:HyperLink> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <br /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </tr> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </table> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </td> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </ItemTemplate> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </asp:DataList> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </form> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </body> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </html> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prize2.aspx.vb
|