Entity Data Source

3 posts, 0 answers
  1. Christian
    Christian avatar
    3 posts
    Member since:
    Jun 2009

    Posted 08 Jun 2009 Link to this post

    Hello,

    I have a treeview which displays a SQL data source. Add the properties I configured the DataFielID and the DataFieldParentID. Thats works great so far. When I select a node I would like to get the whole SQL data row of the select node.  Right now I am just able to get the tex. But I need to pass the informations of the column LocPath to a other window. How can I access that?

    Thanks for help.

    6  
    7 <html xmlns="http://www.w3.org/1999/xhtml" > 
    8 <head runat="server">  
    9     <title></title>  
    10 </head> 
    11 <body onloadonload=onload="AdjustRadWidow();"> 
    12  <script type="text/javascript">  
    13         function GetRadWindow()  
    14         {  
    15             var oWindow = null;  
    16             if (window.radWindow) oWindow = window.radWindow;  
    17             else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
    18             return oWindow;  
    19         }  
    20         function AdjustRadWidow() {  
    21             setTimeout(function() { GetRadWindow().autoSize() }, 200);  
    22         }  
    23  
    24         function returnToParent() {  
    25             //create the argument that will be returned to the parent page  
    26             var oArg = new Object();           
    27  
    28             //get the selected date from RadDatePicker  
    29             var treeView = $find("<%= RadTreeView1.ClientID %>");  
    30             var selectedNode = treeView.get_selectedNode();              
    31             oArg.TreeText = selectedNode._text;  
    32  
    33             //get a reference to the current RadWindow  
    34             var oWnd = GetRadWindow();  
    35  
    36             //Close the RadWindow and send the argument to the parent page  
    37             oWnd.close(oArg);  
    38         }  
    39         </script> 
    40  
    41  
    42     <form id="form1" runat="server">  
    43     <div> 
    44       
    45        <asp:ScriptManager ID="ScriptManager1" runat="server">  
    46         </asp:ScriptManager> 
    47         <telerik:RadTreeView ID="RadTreeView1" Runat="server" DataFieldID="LocPK"   
    48             DataFieldParentID="ParentLocPK" DataSourceID="LocationsQuery"   
    49             DataTextField="LocID" AppendDataBoundItems="True">  
    50         </telerik:RadTreeView> 
    51         <asp:SqlDataSource ID="LocationsQuery" runat="server"   
    52             ConnectionString="..." 
    53             SelectCommand="SELECT [LocPK], [LocID], [LocPath], [ParentLocPK]  FROM [MMLocations]">  
    54         </asp:SqlDataSource> 
    55         <button title="Submit" id="close" onclick="returnToParent(); return false;">  
    56                     Submit</button>      
    57     </div> 
    58     </form> 
    59 </body> 
    60 </html> 
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 08 Jun 2009 Link to this post

    Hello Christian,

    You cannot associate the whole data row with a tree node. What you can do is store the field which corresponds to DataFieldID in the Value property. Then you can use the Value to retrieve the record which corresponds to a specific node.

    <telerik:RadTreeView DataValueField="LocPK" />

    If you need to access all data row details on the client-side you may consider using custom attributes.

    Regards,
    Albert
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Christian
    Christian avatar
    3 posts
    Member since:
    Jun 2009

    Posted 09 Jun 2009 Link to this post

    Hello,

    thanks with the attributes I made a work around.
Back to Top