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

Telerik.Web.UI.GridBoundColumn' does not have a public property named 'Columns'.

2 Answers 1884 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nikola
Top achievements
Rank 2
Nikola asked on 25 Oct 2012, 02:44 PM
heey guys
I got this fu... error but i don't know why I checked every thing in my class and code behind still don't know why ..

Error message Type 'Telerik.Web.UI.GridBoundColumn' does not have a public property named 'Columns'.(Cod Line 41)

Code : 
<%@ Page Title="" Language="C#" MasterPageFile="~/ABBMaster.Master" AutoEventWireup="true" CodeBehind="EmployeGrid.aspx.cs" Inherits="HolidayTracker.Employe.EmployeGrid" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="MainRegionContentPlaceHolder" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid ID="RadGrid1" OnPreRender="RadGrid1_PreRender" ShowStatusBar="True" DataSourceID="SqlDataSource1" runat="server" AutoGenerateColumns="False" PageSize="7"
        AllowSorting="True" AllowPaging="True" GridLines="None" CellSpacing="0">
        <PagerStyle Mode="NumericPages" />
        <MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="DepartmentId" AllowMultiColumnSorting="true">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="UserId" DataSourceID="SqlDataSource2" Width="100%" runat="server">
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="DepartmentId" MasterKeyField="DepartmentId" />
                    </ParentTableRelation>
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="Name" DataSourceID="SqlDataSource2" Width="100%" runat="server">
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="Name" MasterKeyField="Name" />
                            </ParentTableRelation>
                            <Columns>
                                <telerik:GridBoundColumn SortExpression="FromData" HeaderText="From Date" HeaderButtonType="TextButton" DataField="FromDate"                                                        UniqueName="FromDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="ToDate" HeaderText="To Date" HeaderButtonType="TextButton" DataField="ToDate" UniqueName="ToDate">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="WorkingTime" HeaderText="Working Time" HeaderButtonType="TextButton" DataField="WorkingTime"                                                UniqueName="WorkingTime">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn SortExpression="VacationDays" HeaderText="Vacation Days" HeaderButtonType="TextButton" DataField="VacationDays"                                             UniqueName="VacationDays">  
                                </ telerik:GridBoundColumn>
                            </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>
                        <telerik:GridBoundColumn SortExpression="Name" HeaderText="Name" HeaderButtonType="TextButton" DataField="Name" UniqueName="Name">
                        </telerik:GridBoundColumn>
                   </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridBoundColumn SortExpression="DepartmentId" HeaderText="DepartmentId" HeaderButtonType="TextButton" DataField="DepartmentId"                                             UniqueName="DepartmentId">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn SortExpression="Name" HeaderText="Department Name" HeaderButtonType="TextButton" DataField="Name" UniqueName="Name">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:HolidayTrackerConnectionString %>" SelectCommand="SELECT [DepartmentId], [Name] FROM [HtDepartment]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:HolidayTrackerConnectionString %>" SelectCommand="SELECT * FROM [AnnualVacationView] ORDER BY [UserId], [Name]"></asp:SqlDataSource>
</asp:Content>
code behind 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace HolidayTracker.Employe
{
    public partial class EmployeGrid : System.Web.UI.Page
    {
           protected void RadGrid1_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                RadGrid1.MasterTableView.Items[0].Expanded = true;
                RadGrid1.MasterTableView.Items[0].ChildItem.NestedTableViews[0].Items[0].Expanded = true;
            }
        }
 
    }
}


as always thanks for your help and fast answers ^^ 

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 26 Oct 2012, 06:16 AM
Hi,

I was able to replicate the issue when I copied your code. I could resolve it when the columns were properly formatted. Here is the code.
aspx:
<Columns>
   <telerik:GridBoundColumn SortExpression="FromData" HeaderText="From Date" HeaderButtonType="TextButton" DataField="FromDate" UniqueName="FromDate"></telerik:GridBoundColumn>
   <telerik:GridBoundColumn SortExpression="ToDate" HeaderText="To Date" HeaderButtonType="TextButton" DataField="ToDate" UniqueName="ToDate"></telerik:GridBoundColumn>
     . . .
</Columns>

Thanks,
Shinu.
0
Nikola
Top achievements
Rank 2
answered on 26 Oct 2012, 06:51 AM
heey Shinu

thanks a lot !!!!!

Tags
Grid
Asked by
Nikola
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Nikola
Top achievements
Rank 2
Share this question
or