Rad TreeView Relational Data binding from database

9 posts, 0 answers
  1. Mahitha Madala
    Mahitha Madala avatar
    9 posts
    Member since:
    Aug 2009

    Posted 22 Sep 2009 Link to this post

    hi,

    I am trying for binding a Relational data from the database to Rad TreeView control.
    Ihave taken a Dept table (primary Key table) , Employee table (related with a foriegn key to Dept table and itself has a primary Key column) and Products table (related with a foriegn key to Employee table).
    I have tried using RelationBindings.Add() methods but, i didn't get the result.

    Please can u tell me how to bind a relational data to a Rad treeview control.

    Thank you,

    regards,
    Mahitha Madala.
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 25 Sep 2009 Link to this post

    Hi Mahitha,

    Thank you for writing.

    Here is an example of how to bind RadTreeView to related tables of the Northwind database.
    Assuming you have a NorthwindDataSet and the Orders and Customers tables are filled properly, the code looks like this:
    RelationBinding binding = new RelationBinding("FK_Orders_Customers"this.northwindDataSet.Orders); 
    binding.DisplayMember = "OrderID"
    this.radTreeView1.RelationBindings.Add(binding); 
    this.radTreeView1.DisplayMember = "ContactName"
    this.radTreeView1.DataSource = this.northwindDataSet.Customers; 

    Write again if you have other questions.

    Sincerely yours,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Mahitha Madala
    Mahitha Madala avatar
    9 posts
    Member since:
    Aug 2009

    Posted 05 Oct 2009 Link to this post

    hi,

    For binding relational data to a Rad tree view i have assigned the datasource by connecting the database , selecting the required tables and using the following code.

     

     

    Dim

    binding As New RelationBinding("FK_Orders_Customers", Me.FKEmpTableDepartmenttableBindingSource)

     

     

    Me.RadTreeView1.RelationBindings.Add(binding)

     

     

     

    Me

    .RadTreeView1.DataSource = Me.TestRadDatabaseDataSet1.Department_table

     

     

                                            (another way)

     

    Me

    .RadTreeView1.DataSource = Me.DepartmenttableBindingSource

     

     

    Me.RadTreeView1.RelationBindings.Add(New RelationBinding("ArtistsAlbums", Me.Emp_TableTableAdapter.))

     

     

    Me.RadTreeView1.RelationBindings.Add(New RelationBinding("AlbumsSongs", Me.FKProductsEmpTableBindingSource))

     

     

    Me.RadTreeView1.RootRelationDisplayName = "Artists"

     In the above senario i can see only the parent table information displayed in the treeview but not the child tables informations.

    Please can anyone suggest any other way or any other properties to be set.

    thank you,

    regards,
    Mahitha Madala.

     

  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 08 Oct 2009 Link to this post

    Hello Mahitha,

    In order to bind RadTreeView to related data tables you must make sure that your RelationBinding objects are created correctly and that you have set the proper DataTable as the DataSource for RadTreeView.

    For example, in the Northwind context with the Orders and Customers tables the binding will look like this:
    Dim ordersCustomers As RelationBinding = New RelationBinding("FK_Orders_Customers", Me.NorthwindDataSet.Orders)
    ordersCustomers.DisplayMember = "OrderID"
       
    Me.RadTreeView1.RelationBindings.Add(ordersCustomers)
       
    Me.RadTreeView1.DisplayMember = "ContactName"
    Me.RadTreeView1.DataSource = Me.NorthwindDataSet.Customers
    Me.RadTreeView1.RootRelationDisplayName = "Customers"
    Write again if you have other questions.

    Sincerely yours,
    Victor
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Mahitha Madala
    Mahitha Madala avatar
    9 posts
    Member since:
    Aug 2009

    Posted 09 Oct 2009 Link to this post

    hey,

    Its working. Its great,  thanks  for all your replies.

    regards,
    Mahitha Madala
  7. rashmi balakrishnan
    rashmi balakrishnan avatar
    1 posts
    Member since:
    May 2010

    Posted 20 May 2010 Link to this post

    Hi,

    Is it possible to bind RAD Tree Control to a MDX query.
    Please provide an example/demo.


    Thanks n Regards,
    Rashmi
  8. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 25 May 2010 Link to this post

    Hi rashmi balakrishnan,

    Thank you for the question.

    RadTreeView currently does not officially support multi-dimensional data sets and has not been tested in such a scenario. If the result of your MDX query supports the IList interface, RadTreeView will have no troubles generating a view for the data, but it is not guaranteed that the result will look intuitive.

    Write again if you have other questions.

    Sincerely yours,
    Victor
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  9. Willem
    Willem avatar
    23 posts
    Member since:
    Dec 2007

    Posted 08 Sep 2010 Link to this post

    is this binding read and write?

    If it is also a writing binding does it support drag and drop?
  10. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 14 Sep 2010 Link to this post

    Hello Willem,

    Thank you for this question. Yes we support drag & drop, however RadTreeView does not modify the underlying data source. Its purpose is only to display the data. If you have further questions, please do not hesitate to write back.

    All the best, Jack
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready