How to display Data from database to Radtreeview

1 Answer 18 Views
Treeview
Nandan
Top achievements
Rank 1
Iron
Iron
Nandan asked on 01 Feb 2022, 12:49 PM

Hi

I want to display report using radtreeview controls. Can somebody help me regarding that i am new to radtreeview control. Currently I am using radgridview to display report.

 

 

Thanks 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Feb 2022, 12:57 PM

Hello, Nandan,

RadTreeView from the Telerik UI for WinForms suite offers exporting its data to xlsx, csv, pdf or txt formats. This is achieved by using the TreeViewSpreadExport. Additional information for the available functionality can be found in the online documentation:

https://docs.telerik.com/devtools/winforms/controls/treeview/export-data/spread-export 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Nandan
Top achievements
Rank 1
Iron
Iron
commented on 01 Feb 2022, 01:35 PM

Hi Dess

 

Thanks for your kind help i dont want to export treeview to excel. But I want to show data in treeview like parent first then child, then their child nodes like that. I have highlight with yellow color. i can explain you MainLot is 22010001 their sub lot is 22010005 child of 22010005- 22010026

Thanks & Regards

Nandan Navale

 

 

 

Dess | Tech Support Engineer, Principal
Telerik team
commented on 03 Feb 2022, 11:11 AM

Hello, Nandan,   

I am really sorry for the misunderstanding. It was caused by the picture from Excel and assuming that you need a report.

The illustrated data seems to represent self-referencing hierarchy which is supported by RadTreeView:
https://docs.telerik.com/devtools/winforms/controls/treeview/data-binding/binding-to-self-referencing-data

I have prepared a sample code snippet for your reference: 

            DataTable dt = new DataTable();
            dt.Columns.Add("Fr_Lot_No", typeof(string));
            dt.Columns.Add("To_Lot_No", typeof(string)); 
            dt.Rows.Add("22010001", "22010005");
            dt.Rows.Add("22010001", "22010008");
            dt.Rows.Add("22010001", "22010009");
            dt.Rows.Add("22010002", "22010010");
            dt.Rows.Add("22010009", "22010025");
            dt.Rows.Add("22010005", "22010026");
            dt.Rows.Add(null, "22010001");

            this.radTreeView1.DisplayMember = "To_Lot_No";
            this.radTreeView1.ParentMember = "Fr_Lot_No";
            this.radTreeView1.ChildMember = "To_Lot_No";
            this.radTreeView1.DataSource = dt;

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

 
Nandan
Top achievements
Rank 1
Iron
Iron
commented on 04 Feb 2022, 12:25 PM

Hi Dess

Thanks again for your help because of you I am able to resolve complex issue with telerik controls.

Again Thank you

Regards

Nandan Navale

 

 

Tags
Treeview
Asked by
Nandan
Top achievements
Rank 1
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or