This is a migrated thread and some comments may be shown as answers.

How to have two child tables in a hierarchical gridview

1 Answer 196 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Edwin
Top achievements
Rank 1
Edwin asked on 01 Apr 2009, 08:39 AM
Hi
According to the online tutorial http://www.telerik.com/help/winforms/grid_tutorial-binding-to-hierarchical-data.html, it seems I can have one master table but more than one child tables in a hierarchical gridview. However I cannot make it work.  I created two child templates and two relationships but I can see only the first child table displayed when expanding the master record.  If I move the second child template up in design view, then I can see the second one but not the first one.  Is it really possible to show two child tables at the same time?  If not, what is the point of having collection for relations and childtemplates?

Here is my design code.

namespace PopularIT.MOSES.POS.UI
{
    partial class frmInvList
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn1 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn2 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn3 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn4 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn5 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn6 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn7 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn8 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn9 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn3 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewDateTimeColumn gridViewDateTimeColumn2 = new Telerik.WinControls.UI.GridViewDateTimeColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn6 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn7 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn12 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn13 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn14 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDateTimeColumn gridViewDateTimeColumn3 = new Telerik.WinControls.UI.GridViewDateTimeColumn();
            Telerik.WinControls.UI.GridViewDateTimeColumn gridViewDateTimeColumn4 = new Telerik.WinControls.UI.GridViewDateTimeColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn8 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn1 = new Telerik.WinControls.UI.GridViewCommandColumn();
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn2 = new Telerik.WinControls.UI.GridViewCommandColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn15 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewRelation gridViewRelation1 = new Telerik.WinControls.UI.GridViewRelation();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmInvList));
            Telerik.WinControls.UI.GridViewRelation gridViewRelation2 = new Telerik.WinControls.UI.GridViewRelation();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn10 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewDateTimeColumn gridViewDateTimeColumn1 = new Telerik.WinControls.UI.GridViewDateTimeColumn();
            Telerik.WinControls.UI.GridViewDecimalColumn gridViewDecimalColumn11 = new Telerik.WinControls.UI.GridViewDecimalColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn4 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn5 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
            this.gridViewTemplate1 = new Telerik.WinControls.UI.GridViewTemplate();
            this.LineBindingSource = new System.Windows.Forms.BindingSource(this.components);
            this.InvoiceBindingSource = new System.Windows.Forms.BindingSource(this.components);
            this.grdInvoices = new Telerik.WinControls.UI.RadGridView();
            this.paymentTemplate = new Telerik.WinControls.UI.GridViewTemplate();
            this.PaymentBindingSource = new System.Windows.Forms.BindingSource(this.components);
            this.panel1 = new System.Windows.Forms.Panel();
            this.btnExit = new System.Windows.Forms.Button();
            this.btnRefresh = new System.Windows.Forms.Button();
            this.label3 = new System.Windows.Forms.Label();
            this.dateFilter = new Telerik.WinControls.UI.RadDateTimePicker();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.txtToInvNum = new System.Windows.Forms.TextBox();
            this.btnReprint = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.txtFromInvNum = new System.Windows.Forms.TextBox();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            ((System.ComponentModel.ISupportInitialize)(this.gridViewTemplate1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.LineBindingSource)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.InvoiceBindingSource)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdInvoices)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdInvoices.MasterGridViewTemplate)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.paymentTemplate)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.PaymentBindingSource)).BeginInit();
            this.panel1.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dateFilter)).BeginInit();
            this.groupBox1.SuspendLayout();
            this.tableLayoutPanel1.SuspendLayout();
            this.SuspendLayout();
            //
            // gridViewTemplate1
            //
            this.gridViewTemplate1.AllowAddNewRow = false;
            this.gridViewTemplate1.AllowDeleteRow = false;
            this.gridViewTemplate1.AllowEditRow = false;
            this.gridViewTemplate1.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            gridViewDecimalColumn1.DataType = typeof(int);
            gridViewDecimalColumn1.FieldAlias = "invl_Id";
            gridViewDecimalColumn1.FieldName = "invl_Id";
            gridViewDecimalColumn1.HeaderText = "invl_Id";
            gridViewDecimalColumn1.IsAutoGenerated = true;
            gridViewDecimalColumn1.IsVisible = false;
            gridViewDecimalColumn1.UniqueName = "invl_Id";
            gridViewDecimalColumn2.DataType = typeof(int);
            gridViewDecimalColumn2.FieldAlias = "invl_InvoiceId";
            gridViewDecimalColumn2.FieldName = "invl_InvoiceId";
            gridViewDecimalColumn2.HeaderText = "invl_InvoiceId";
            gridViewDecimalColumn2.IsAutoGenerated = true;
            gridViewDecimalColumn2.IsVisible = false;
            gridViewDecimalColumn2.UniqueName = "invl_InvoiceId";
            gridViewDecimalColumn3.DataType = typeof(int);
            gridViewDecimalColumn3.FieldAlias = "invl_ItemId";
            gridViewDecimalColumn3.FieldName = "invl_ItemId";
            gridViewDecimalColumn3.HeaderText = "invl_ItemId";
            gridViewDecimalColumn3.IsAutoGenerated = true;
            gridViewDecimalColumn3.IsVisible = false;
            gridViewDecimalColumn3.UniqueName = "invl_ItemId";
            gridViewTextBoxColumn1.FieldAlias = "item_Code";
            gridViewTextBoxColumn1.FieldName = "item_Code";
            gridViewTextBoxColumn1.HeaderText = "Item Code";
            gridViewTextBoxColumn1.MinWidth = 80;
            gridViewTextBoxColumn1.UniqueName = "item_Code";
            gridViewTextBoxColumn1.Width = 80;
            gridViewTextBoxColumn2.FieldAlias = "item_Name";
            gridViewTextBoxColumn2.FieldName = "item_Name";
            gridViewTextBoxColumn2.HeaderText = "Item Name";
            gridViewTextBoxColumn2.MinWidth = 150;
            gridViewTextBoxColumn2.UniqueName = "item_Name";
            gridViewTextBoxColumn2.Width = 150;
            gridViewDecimalColumn4.DataType = typeof(decimal);
            gridViewDecimalColumn4.FieldAlias = "invl_Qty";
            gridViewDecimalColumn4.FieldName = "invl_Qty";
            gridViewDecimalColumn4.HeaderText = "Qty";
            gridViewDecimalColumn4.IsAutoGenerated = true;
            gridViewDecimalColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn4.ThousandsSeparator = true;
            gridViewDecimalColumn4.UniqueName = "invl_Qty";
            gridViewDecimalColumn5.DataType = typeof(int);
            gridViewDecimalColumn5.FieldAlias = "invl_UOMId";
            gridViewDecimalColumn5.FieldName = "invl_UOMId";
            gridViewDecimalColumn5.HeaderText = "invl_UOMId";
            gridViewDecimalColumn5.IsAutoGenerated = true;
            gridViewDecimalColumn5.IsVisible = false;
            gridViewDecimalColumn5.UniqueName = "invl_UOMId";
            gridViewDecimalColumn6.DataType = typeof(decimal);
            gridViewDecimalColumn6.FieldAlias = "invl_UnitPrice";
            gridViewDecimalColumn6.FieldName = "invl_UnitPrice";
            gridViewDecimalColumn6.HeaderText = "Unit Price";
            gridViewDecimalColumn6.IsAutoGenerated = true;
            gridViewDecimalColumn6.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn6.ThousandsSeparator = true;
            gridViewDecimalColumn6.UniqueName = "invl_UnitPrice";
            gridViewDecimalColumn7.DataType = typeof(decimal);
            gridViewDecimalColumn7.FieldAlias = "invl_DiscountRate";
            gridViewDecimalColumn7.FieldName = "invl_DiscountRate";
            gridViewDecimalColumn7.HeaderText = "Discount %";
            gridViewDecimalColumn7.IsAutoGenerated = true;
            gridViewDecimalColumn7.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewDecimalColumn7.ThousandsSeparator = true;
            gridViewDecimalColumn7.UniqueName = "invl_DiscountRate";
            gridViewDecimalColumn8.DataType = typeof(decimal);
            gridViewDecimalColumn8.FieldAlias = "invl_NetUnitPrice";
            gridViewDecimalColumn8.FieldName = "invl_NetUnitPrice";
            gridViewDecimalColumn8.HeaderText = "Net Unit Price";
            gridViewDecimalColumn8.IsAutoGenerated = true;
            gridViewDecimalColumn8.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn8.ThousandsSeparator = true;
            gridViewDecimalColumn8.UniqueName = "invl_NetUnitPrice";
            gridViewDecimalColumn9.FieldAlias = "lineAmount";
            gridViewDecimalColumn9.FieldName = "lineAmount";
            gridViewDecimalColumn9.HeaderText = "Amount";
            gridViewDecimalColumn9.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn9.ThousandsSeparator = true;
            gridViewDecimalColumn9.UniqueName = "lineAmount";
            gridViewTextBoxColumn3.FieldAlias = "invl_Remark";
            gridViewTextBoxColumn3.FieldName = "invl_Remark";
            gridViewTextBoxColumn3.HeaderText = "Remark";
            gridViewTextBoxColumn3.IsAutoGenerated = true;
            gridViewTextBoxColumn3.UniqueName = "invl_Remark";
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn1);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn2);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn3);
            this.gridViewTemplate1.Columns.Add(gridViewTextBoxColumn1);
            this.gridViewTemplate1.Columns.Add(gridViewTextBoxColumn2);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn4);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn5);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn6);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn7);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn8);
            this.gridViewTemplate1.Columns.Add(gridViewDecimalColumn9);
            this.gridViewTemplate1.Columns.Add(gridViewTextBoxColumn3);
            this.gridViewTemplate1.DataSource = this.LineBindingSource;
            //
            // LineBindingSource
            //
            this.LineBindingSource.AllowNew = false;
            this.LineBindingSource.DataMember = "tblinvl_InvoiceLines";
            this.LineBindingSource.DataSource = this.InvoiceBindingSource;
            //
            // InvoiceBindingSource
            //
            this.InvoiceBindingSource.AllowNew = false;
            this.InvoiceBindingSource.DataSource = typeof(PopularIT.MOSES.POS.Data.tblinvo_Invoice);
            //
            // grdInvoices
            //
            this.grdInvoices.Dock = System.Windows.Forms.DockStyle.Fill;
            this.grdInvoices.Location = new System.Drawing.Point(3, 113);
            //
            // grdInvoices
            //
            this.grdInvoices.MasterGridViewTemplate.AllowAddNewRow = false;
            this.grdInvoices.MasterGridViewTemplate.AllowDeleteRow = false;
            this.grdInvoices.MasterGridViewTemplate.AllowEditRow = false;
            this.grdInvoices.MasterGridViewTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            this.grdInvoices.MasterGridViewTemplate.ChildGridViewTemplates.AddRange(new Telerik.WinControls.UI.GridViewTemplate[] {
            this.paymentTemplate,
            this.gridViewTemplate1});
            gridViewDateTimeColumn2.DataType = typeof(System.DateTime);
            gridViewDateTimeColumn2.FieldAlias = "invo_CreateDate";
            gridViewDateTimeColumn2.FieldName = "invo_CreateDate";
            gridViewDateTimeColumn2.HeaderText = "Date";
            gridViewDateTimeColumn2.MaxWidth = 140;
            gridViewDateTimeColumn2.UniqueName = "invo_CreateDate";
            gridViewDateTimeColumn2.Width = 114;
            gridViewTextBoxColumn6.FieldAlias = "invo_Num";
            gridViewTextBoxColumn6.FieldName = "invo_Num";
            gridViewTextBoxColumn6.HeaderText = "Invoice #";
            gridViewTextBoxColumn6.MaxWidth = 120;
            gridViewTextBoxColumn6.ReadOnly = true;
            gridViewTextBoxColumn6.UniqueName = "invo_Num";
            gridViewTextBoxColumn6.Width = 114;
            gridViewTextBoxColumn7.FieldAlias = "invo_CustomerName";
            gridViewTextBoxColumn7.FieldName = "invo_CustomerName";
            gridViewTextBoxColumn7.HeaderText = "Customer";
            gridViewTextBoxColumn7.MinWidth = 68;
            gridViewTextBoxColumn7.UniqueName = "invo_CustomerName";
            gridViewTextBoxColumn7.Width = 85;
            gridViewDecimalColumn12.FieldAlias = "totalPurchase";
            gridViewDecimalColumn12.FieldName = "totalPurchase";
            gridViewDecimalColumn12.HeaderText = "Total Purchase";
            gridViewDecimalColumn12.MinWidth = 100;
            gridViewDecimalColumn12.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn12.UniqueName = "totalPurchase";
            gridViewDecimalColumn12.Width = 130;
            gridViewDecimalColumn13.FieldAlias = "invo_DiscountAmt";
            gridViewDecimalColumn13.FieldName = "invo_DiscountAmt";
            gridViewDecimalColumn13.HeaderText = "Discount";
            gridViewDecimalColumn13.MinWidth = 50;
            gridViewDecimalColumn13.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn13.UniqueName = "invo_DiscountAmt";
            gridViewDecimalColumn13.Width = 63;
            gridViewDecimalColumn14.FieldAlias = "invTotal";
            gridViewDecimalColumn14.FieldName = "invTotal";
            gridViewDecimalColumn14.HeaderText = "Net Total";
            gridViewDecimalColumn14.MinWidth = 100;
            gridViewDecimalColumn14.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn14.ThousandsSeparator = true;
            gridViewDecimalColumn14.UniqueName = "invTotal";
            gridViewDecimalColumn14.Width = 130;
            gridViewDateTimeColumn3.DataType = typeof(System.Nullable<System.DateTime>);
            gridViewDateTimeColumn3.FieldAlias = "invo_SynDate";
            gridViewDateTimeColumn3.FieldName = "invo_SynDate";
            gridViewDateTimeColumn3.HeaderText = "Syn Date";
            gridViewDateTimeColumn3.MaxWidth = 140;
            gridViewDateTimeColumn3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewDateTimeColumn3.UniqueName = "invo_SynDate";
            gridViewDateTimeColumn3.Width = 124;
            gridViewDateTimeColumn4.DataType = typeof(System.Nullable<System.DateTime>);
            gridViewDateTimeColumn4.FieldAlias = "invo_VoidDate";
            gridViewDateTimeColumn4.FieldName = "invo_VoidDate";
            gridViewDateTimeColumn4.HeaderText = "Void Date";
            gridViewDateTimeColumn4.MaxWidth = 140;
            gridViewDateTimeColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewDateTimeColumn4.UniqueName = "invo_VoidDate";
            gridViewDateTimeColumn4.Width = 66;
            gridViewTextBoxColumn8.FieldAlias = "invo_VoidByName";
            gridViewTextBoxColumn8.FieldName = "invo_VoidByName";
            gridViewTextBoxColumn8.HeaderText = "Voided By";
            gridViewTextBoxColumn8.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewTextBoxColumn8.UniqueName = "invo_VoidByName";
            gridViewTextBoxColumn8.Width = 5;
            gridViewCommandColumn1.AllowGroup = false;
            gridViewCommandColumn1.DefaultText = "Print";
            gridViewCommandColumn1.FieldAlias = "Print";
            gridViewCommandColumn1.HeaderText = "Print";
            gridViewCommandColumn1.MaxWidth = 50;
            gridViewCommandColumn1.MinWidth = 50;
            gridViewCommandColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewCommandColumn1.UniqueName = "Print";
            gridViewCommandColumn1.UseDefaultText = true;
            gridViewCommandColumn2.AllowGroup = false;
            gridViewCommandColumn2.DefaultText = "Void";
            gridViewCommandColumn2.FieldAlias = "Void";
            gridViewCommandColumn2.HeaderText = "Void";
            gridViewCommandColumn2.MaxWidth = 50;
            gridViewCommandColumn2.MinWidth = 50;
            gridViewCommandColumn2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewCommandColumn2.UniqueName = "Void";
            gridViewCommandColumn2.UseDefaultText = true;
            gridViewDecimalColumn15.DataType = typeof(int);
            gridViewDecimalColumn15.FieldAlias = "invo_ID";
            gridViewDecimalColumn15.FieldName = "invo_ID";
            gridViewDecimalColumn15.HeaderText = "invo_ID";
            gridViewDecimalColumn15.IsVisible = false;
            gridViewDecimalColumn15.UniqueName = "invo_ID";
            gridViewDecimalColumn15.Width = 46;
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewDateTimeColumn2);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn6);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn7);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewDecimalColumn12);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewDecimalColumn13);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewDecimalColumn14);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewDateTimeColumn3);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewDateTimeColumn4);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewTextBoxColumn8);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewCommandColumn1);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewCommandColumn2);
            this.grdInvoices.MasterGridViewTemplate.Columns.Add(gridViewDecimalColumn15);
            this.grdInvoices.MasterGridViewTemplate.DataSource = this.InvoiceBindingSource;
            this.grdInvoices.Name = "grdInvoices";
            gridViewRelation1.ChildColumnNames = ((System.Collections.Specialized.StringCollection)(resources.GetObject("gridViewRelation1.ChildColumnNames")));
            gridViewRelation1.ChildTemplate = this.paymentTemplate;
            gridViewRelation1.ParentColumnNames = ((System.Collections.Specialized.StringCollection)(resources.GetObject("gridViewRelation1.ParentColumnNames")));
            gridViewRelation1.ParentTemplate = this.grdInvoices.MasterGridViewTemplate;
            gridViewRelation1.RelationName = "InvoicePayment";
            gridViewRelation2.ChildColumnNames = ((System.Collections.Specialized.StringCollection)(resources.GetObject("gridViewRelation2.ChildColumnNames")));
            gridViewRelation2.ChildTemplate = this.gridViewTemplate1;
            gridViewRelation2.ParentColumnNames = ((System.Collections.Specialized.StringCollection)(resources.GetObject("gridViewRelation2.ParentColumnNames")));
            gridViewRelation2.ParentTemplate = this.grdInvoices.MasterGridViewTemplate;
            gridViewRelation2.RelationName = "headerLine";
            this.grdInvoices.Relations.Add(gridViewRelation1);
            this.grdInvoices.Relations.Add(gridViewRelation2);
            this.grdInvoices.Size = new System.Drawing.Size(952, 358);
            this.grdInvoices.TabIndex = 0;
            this.grdInvoices.CommandCellClick += new Telerik.WinControls.UI.CommandCellClickEventHandler(this.grdInvoices_CommandCellClick);
            this.grdInvoices.SelectionChanged += new System.EventHandler(this.grdInvoices_SelectionChanged);
            this.grdInvoices.DataBindingComplete += new Telerik.WinControls.UI.GridViewBindingCompleteEventHandler(this.grdInvoices_DataBindingComplete);
            //
            // paymentTemplate
            //
            this.paymentTemplate.AllowAddNewRow = false;
            this.paymentTemplate.AllowDeleteRow = false;
            this.paymentTemplate.AllowEditRow = false;
            this.paymentTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
            gridViewDecimalColumn10.DecimalPlaces = 0;
            gridViewDecimalColumn10.FieldAlias = "ipay_InvoiceId";
            gridViewDecimalColumn10.FieldName = "ipay_InvoiceId";
            gridViewDecimalColumn10.HeaderText = "ipay_InvoiceId";
            gridViewDecimalColumn10.IsVisible = false;
            gridViewDecimalColumn10.UniqueName = "ipay_InvoiceId";
            gridViewDateTimeColumn1.FieldAlias = "ipay_CreateDate";
            gridViewDateTimeColumn1.FieldName = "ipay_CreateDate";
            gridViewDateTimeColumn1.HeaderText = "Date";
            gridViewDateTimeColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
            gridViewDateTimeColumn1.UniqueName = "ipay_CreateDate";
            gridViewDecimalColumn11.FieldAlias = "amountReceived";
            gridViewDecimalColumn11.FieldName = "amountReceived";
            gridViewDecimalColumn11.HeaderText = "Amt Received";
            gridViewDecimalColumn11.TextAlignment = System.Drawing.ContentAlignment.MiddleRight;
            gridViewDecimalColumn11.UniqueName = "amountReceived";
            gridViewTextBoxColumn4.FieldAlias = "paym_Name";
            gridViewTextBoxColumn4.FieldName = "paym_Name";
            gridViewTextBoxColumn4.HeaderText = "Pay by";
            gridViewTextBoxColumn4.UniqueName = "paym_Name";
            gridViewTextBoxColumn5.FieldAlias = "ipay_Ref";
            gridViewTextBoxColumn5.FieldName = "ipay_Ref";
            gridViewTextBoxColumn5.HeaderText = "Ref";
            gridViewTextBoxColumn5.UniqueName = "ipay_Ref";
            this.paymentTemplate.Columns.Add(gridViewDecimalColumn10);
            this.paymentTemplate.Columns.Add(gridViewDateTimeColumn1);
            this.paymentTemplate.Columns.Add(gridViewDecimalColumn11);
            this.paymentTemplate.Columns.Add(gridViewTextBoxColumn4);
            this.paymentTemplate.Columns.Add(gridViewTextBoxColumn5);
            this.paymentTemplate.DataSource = this.PaymentBindingSource;
            //
            // PaymentBindingSource
            //
            this.PaymentBindingSource.AllowNew = false;
            this.PaymentBindingSource.DataMember = "tblipay_InvPayments";
            this.PaymentBindingSource.DataSource = this.InvoiceBindingSource;
            //
            // panel1
            //
            this.panel1.AutoSize = true;
            this.panel1.Controls.Add(this.btnExit);
            this.panel1.Controls.Add(this.btnRefresh);
            this.panel1.Controls.Add(this.label3);
            this.panel1.Controls.Add(this.dateFilter);
            this.panel1.Controls.Add(this.groupBox1);
            this.panel1.Location = new System.Drawing.Point(3, 3);
            this.panel1.MaximumSize = new System.Drawing.Size(0, 100);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(534, 97);
            this.panel1.TabIndex = 1;
            //
            // btnExit
            //
            this.btnExit.Location = new System.Drawing.Point(456, 28);
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(75, 23);
            this.btnExit.TabIndex = 8;
            this.btnExit.Text = "Exit";
            this.btnExit.UseVisualStyleBackColor = true;
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            //
            // btnRefresh
            //
            this.btnRefresh.Location = new System.Drawing.Point(254, 71);
            this.btnRefresh.Name = "btnRefresh";
            this.btnRefresh.Size = new System.Drawing.Size(75, 23);
            this.btnRefresh.TabIndex = 7;
            this.btnRefresh.Text = "Refresh";
            this.btnRefresh.UseVisualStyleBackColor = true;
            this.btnRefresh.Click += new System.EventHandler(this.btnRefresh_Click);
            //
            // label3
            //
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(12, 79);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(80, 13);
            this.label3.TabIndex = 6;
            this.label3.Text = "List invoices on";
            //
            // dateFilter
            //
            this.dateFilter.AutoSize = true;
            this.dateFilter.Checked = true;
            this.dateFilter.Format = System.Windows.Forms.DateTimePickerFormat.Long;
            this.dateFilter.Location = new System.Drawing.Point(98, 72);
            this.dateFilter.MaxDate = new System.DateTime(9998, 12, 31, 0, 0, 0, 0);
            this.dateFilter.MinDate = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);
            this.dateFilter.Name = "dateFilter";
            this.dateFilter.NullDate = new System.DateTime(1900, 1, 1, 0, 0, 0, 0);
            this.dateFilter.Size = new System.Drawing.Size(150, 22);
            this.dateFilter.TabIndex = 5;
            this.dateFilter.Text = "radDateTimePicker1";
            this.dateFilter.Value = new System.DateTime(2009, 3, 20, 17, 52, 7, 825);
            this.dateFilter.ValueChanged += new System.EventHandler(this.dateFilter_ValueChanged);
            //
            // groupBox1
            //
            this.groupBox1.Controls.Add(this.txtToInvNum);
            this.groupBox1.Controls.Add(this.btnReprint);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.txtFromInvNum);
            this.groupBox1.Location = new System.Drawing.Point(12, 12);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(404, 54);
            this.groupBox1.TabIndex = 4;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Reprint invoice";
            //
            // txtToInvNum
            //
            this.txtToInvNum.Location = new System.Drawing.Point(201, 19);
            this.txtToInvNum.Name = "txtToInvNum";
            this.txtToInvNum.Size = new System.Drawing.Size(100, 20);
            this.txtToInvNum.TabIndex = 1;
            //
            // btnReprint
            //
            this.btnReprint.Location = new System.Drawing.Point(307, 16);
            this.btnReprint.Name = "btnReprint";
            this.btnReprint.Size = new System.Drawing.Size(75, 23);
            this.btnReprint.TabIndex = 2;
            this.btnReprint.Text = "Reprint";
            this.btnReprint.UseVisualStyleBackColor = true;
            this.btnReprint.Click += new System.EventHandler(this.btnReprint_Click);
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(12, 22);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(54, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "From inv#";
            //
            // label2
            //
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(179, 22);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(16, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "to";
            //
            // txtFromInvNum
            //
            this.txtFromInvNum.Location = new System.Drawing.Point(72, 19);
            this.txtFromInvNum.Name = "txtFromInvNum";
            this.txtFromInvNum.Size = new System.Drawing.Size(100, 20);
            this.txtFromInvNum.TabIndex = 0;
            //
            // tableLayoutPanel1
            //
            this.tableLayoutPanel1.ColumnCount = 1;
            this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0);
            this.tableLayoutPanel1.Controls.Add(this.grdInvoices, 0, 1);
            this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
            this.tableLayoutPanel1.Name = "tableLayoutPanel1";
            this.tableLayoutPanel1.RowCount = 2;
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 110F));
            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tableLayoutPanel1.Size = new System.Drawing.Size(958, 474);
            this.tableLayoutPanel1.TabIndex = 2;
            //
            // frmInvList
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(958, 474);
            this.Controls.Add(this.tableLayoutPanel1);
            this.Name = "frmInvList";
            this.ShowInTaskbar = false;
            this.Text = "Invoice List";
            this.Load += new System.EventHandler(this.frmInvList_Load);
            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmInvList_FormClosing);
            ((System.ComponentModel.ISupportInitialize)(this.gridViewTemplate1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.LineBindingSource)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.InvoiceBindingSource)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdInvoices.MasterGridViewTemplate)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.grdInvoices)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.paymentTemplate)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.PaymentBindingSource)).EndInit();
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            ((System.ComponentModel.ISupportInitialize)(this.dateFilter)).EndInit();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.tableLayoutPanel1.ResumeLayout(false);
            this.tableLayoutPanel1.PerformLayout();
            this.ResumeLayout(false);

        }

        #endregion

        private Telerik.WinControls.UI.RadGridView grdInvoices;
        private System.Windows.Forms.BindingSource InvoiceBindingSource;
        private System.Windows.Forms.BindingSource LineBindingSource;
        private System.Windows.Forms.Panel panel1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox txtToInvNum;
        private System.Windows.Forms.TextBox txtFromInvNum;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnReprint;
        private System.Windows.Forms.Label label3;
        private Telerik.WinControls.UI.RadDateTimePicker dateFilter;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Button btnRefresh;
        private Telerik.WinControls.UI.GridViewTemplate gridViewTemplate1;
        private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
        private System.Windows.Forms.Button btnExit;
        private System.Windows.Forms.BindingSource PaymentBindingSource;
        private Telerik.WinControls.UI.GridViewTemplate paymentTemplate;
    }
}

1 Answer, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 01 Apr 2009, 10:23 AM
Hello Edwin,

I understand your concerns. Currently RadGridView can visualize only one ChildViewTemplate at the same level in the hierarchy. This is a limitation that we plan to overcome in one of our upcoming releases.

Should you have other questions, don't hesitate to write us.

Regards,
Jack
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
Edwin
Top achievements
Rank 1
Answers by
Jack
Telerik team
Share this question
or