Current filter:
                                You should refresh the page.
                                0
                                  • Hi,

                                    I would like to request an example on how to Embed a XtraTreeList inside an XtraReport detail. The examples that I've downloaded and tried and failed probably because they are outdated already.

                                    thanks in advance,

                                    jep

                                0

                                Hi Jep,

                                I do not quite understand this issue. You can embed the TreeList control into the detail band of the report via an instance of the WinControlContainer class. Can you please describe the problem you are trying to resolve in this manner in greater detail? I will try to prepare an example, according to your requirements.

                                Thanks,
                                Elliot

                                0

                                Hi Elliot,

                                I tried the examples in your site and its working in 9.3. But when I used 10.2. the PrintingSystem.PreviewExForm.BindingContext becomes unidentified.

                                below is the actual beforeprint event handler:

                                            DataTable dtTemp = new DataTable();
                                            dtTemp.Columns.Add("id", typeof(int));
                                            dtTemp.Columns.Add("ParentId", typeof(int));
                                            dtTemp.Columns.Add("code", typeof(string));
                                            dtTemp.Columns.Add("name", typeof(string));
                                            dtTemp.Columns.Add("type", typeof(string));
                                            dtTemp.Columns.Add("sac", typeof(string));

                                            for (int i = 0; i < 10; i++)
                                            {
                                                string j = i.ToString();
                                                dtTemp.Rows.Add(i, 0, "code" + j, "name" + j, "type" + j, "sac" + j);
                                            }

                                            TreeList tree = new DevExpress.XtraTreeList.TreeList();
                                            tree.ParentChanged += new EventHandler(tree_ParentChanged);
                                            
                                            tree.BeginUpdate();
                                            TreeListColumn colCode = new TreeListColumn() { FieldName = "code", Caption = "code" };
                                            TreeListColumn colName = new TreeListColumn() { FieldName = "name", Caption = "name" };
                                            TreeListColumn colType = new TreeListColumn() { FieldName = "type", Caption = "type" };
                                            TreeListColumn colSA = new TreeListColumn() { FieldName = "sac", Caption = "sac" };
                                            tree.Columns.AddRange(new TreeListColumn[] { colCode, colName, colType, colSA });

                                            WinControlContainer wcc = new WinControlContainer();
                                            Detail.Controls.Add(wcc);
                                            wcc.WinControl = tree;
                                            tree.KeyFieldName = "id";
                                            tree.ParentFieldName = "ParentId";
                                            tree.DataSource = dtTemp;
                                            //tree.BindingContext = PrintingSystem.PreviewFormEx.BindingContext;
                                            tree.EndUpdate();

                                notice that I have to comment out the BindingContext property. In the 9.3, if this is commented out, the TreeList is also not showing.

                                Thanks in advance.

                                Jep

                                0

                                Hi Jep,

                                Thank you for your feedback. Please note that you should set the Parent property for a TreeList to avoid this problem. Please refer to the code below:

                                	
                                [C#]
                                Form form = new Form(); TreeList tree = new DevExpress.XtraTreeList.TreeList(); tree.Parent = form; ...

                                We look forward to your feedback once you have had the opportunity to try this approach.

                                Thanks,
                                Sergi

                                0

                                Hi Sergi,

                                I think you overlook the fact that I'm trying to embed an XtraTreeList inside the detail band of an XtraReport. Can you just please try and provide me a simple working example of an XtraTreeList inside an XtraReport using 10.2

                                thanks,
                                jep

                                0

                                Hi Jep,

                                Thank you for your feedback. Attached is a sample project, illustrating how you can show the XtraTreeList within the XtraReport. Please review it and let us know whether or not this information helps you.

                                Thanks,
                                Sergi

                                B199826.zip
                                0

                                Hi Sergi,

                                Thanks for the sample but I need to create the treelist on runtime. also the sample you've provided is not working(pls. see attached screenshot)

                                regards,
                                jep

                                xtratreelist with xtrareports.png
                                0

                                Hi Jep,

                                Thank you for your feedback. I have modified my previous sample project according to your requirements. Please find it in the attachment. Please let us know whether or not the problem still persists.

                                Thanks,
                                Sergi

                                B199826.zip
                                0

                                Thanks Sergi. This is what I'm looking for.

                                0

                                Fixed by sergi with the latest code sample

                                0

                                Hi Jep,

                                I am glad to hear that the problem has been resolved. Thank you for letting us know of your progress.
                                Please feel free to contact us if you have any difficulties. We will be happy to assist you.

                                Thanks,
                                Sergi

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.