private void RadGridView1_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            GridViewDataControl dataControl = (GridViewDataControl)sender;

            if (dataControl.ParentRow != null)
            {
                dataControl.GridLinesVisibility  = GridLinesVisibility.None;
                dataControl.ShowGroupPanel       = false;
                dataControl.AutoGenerateColumns  = false;
                dataControl.CanUserFreezeColumns = false;
                dataControl.IsReadOnly           = true;
                dataControl.ChildTableDefinitions.Clear();


                GridViewDataColumn column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("EmployeeID");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("FirstName");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("LastName");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("Title");
                dataControl.Columns.Add(column);
            }
        }
        private void RadGridView1_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            GridViewDataControl dataControl = (GridViewDataControl) sender;
            if (dataControl.ParentRow != null)
            {
                dataControl.BorderThickness = new Thickness(0, 1, 0, 1);
                dataControl.GridLinesVisibility = GridLinesVisibility.None;
                dataControl.ShowGroupPanel = false;
                dataControl.AutoGenerateColumns = false;
                dataControl.CanUserFreezeColumns = false;
                dataControl.IsReadOnly = true;
                dataControl.ChildTableDefinitions.Clear();


                GridViewDataColumn column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("EmployeeID");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("FirstName");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("LastName");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.DataMemberBinding = new Binding("Title");
                dataControl.Columns.Add(column);
            }
        }
        private void gridView_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            GridViewDataControl dataControl = (GridViewDataControl)sender;

            if (dataControl.ParentRow != null)
            {
                dataControl.GridLinesVisibility  = GridLinesVisibility.None;
                dataControl.CanUserFreezeColumns = false;
                dataControl.ShowGroupPanel       = false;
                dataControl.AutoGenerateColumns  = false;

                GridViewDataColumn column = new GridViewDataColumn();
                column.Header            = "Order ID";
                column.DataMemberBinding = new System.Windows.Data.Binding("OrderID");
                dataControl.Columns.Add(column);

                column                   = new GridViewDataColumn();
                column.Header            = "Product ID";
                column.DataMemberBinding = new System.Windows.Data.Binding("ProductID");
                dataControl.Columns.Add(column);

                column                   = new GridViewDataColumn();
                column.Header            = "Unit Price";
                column.DataFormatString  = "{0:c}";
                column.DataMemberBinding = new System.Windows.Data.Binding("UnitPrice");
                dataControl.Columns.Add(column);

                column                   = new GridViewDataColumn();
                column.Header            = "Quantity";
                column.DataMemberBinding = new System.Windows.Data.Binding("Quantity");
                dataControl.Columns.Add(column);
            }
        }
Example #4
0
        private void dgPortfolioDetails_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            GridViewDataControl dataControl = (GridViewDataControl)sender;

            if (dataControl.ParentRow != null)
            {
                //dataControl is the child gridview
                dataControl.ShowGroupPanel = false;
            }
        }
        private void gridView_DataLoading(object sender, GridViewDataLoadingEventArgs e)
        {
            GridViewDataControl dataControl = (GridViewDataControl)sender;
            if (dataControl.ParentRow != null)
            {
                dataControl.BorderThickness = new Thickness(0, 1, 0, 1);
                dataControl.GridLinesVisibility = GridLinesVisibility.None;
                dataControl.CanUserFreezeColumns = false;
                dataControl.ShowGroupPanel = false;
                dataControl.AutoGenerateColumns = false;

                GridViewDataColumn column = new GridViewDataColumn();
                column.Header = "Order ID";
                column.DataMemberBinding = new System.Windows.Data.Binding("OrderID");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.Header = "Product ID";
                column.DataMemberBinding = new System.Windows.Data.Binding("ProductID");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.Header = "Unit Price";
                column.DataFormatString = "{0:c}";
                column.DataMemberBinding = new System.Windows.Data.Binding("UnitPrice");
                dataControl.Columns.Add(column);

                column = new GridViewDataColumn();
                column.Header = "Quantity";
                column.DataMemberBinding = new System.Windows.Data.Binding("Quantity");
                dataControl.Columns.Add(column);
            }
        }