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

RadGrid Showing two column but don't know from where it showing data

4 Answers 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
virender
Top achievements
Rank 1
virender asked on 27 Dec 2012, 02:25 PM
hi,

I have radgrid ,its showing two others column but in database view its only exists, Bold column not exists in view. 

I attached output of radgrid.

View's Column
---------------------
 ,[StartDate]      ,[EndDate]      ,[DepartmentName]      ,[LabourRate]      ,[BillingRate]      ,[AgencyRate]      ,[FirstName]      ,[LastName]
 ,[Description]      ,[ManagerFirst]   ,[ManagerLast]     ,[WeekEnding]    ,[Hours]    ,[RateType]  ,[TimesheetStatus]  ,[TimesheetID]

---------------------


<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h1>Current Contractors</h1>
    <br/>
        <telerik:RadButton ID="RadButton1" runat="server" onclick="RadButton1_Click" 
        Text="Previous">
    </telerik:RadButton>
    <telerik:RadButton ID="RadButton2" runat="server" onclick="RadButton2_Click" 
        Text="Next">
    </telerik:RadButton>
    <br/>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" 
        CellSpacing="0" DataSourceID="ObjectDataSource1" GridLines="None" 
        AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" 
        ExportSettings-FileName="Payroll Report" ExportSettings-ExportOnlyData="False" 
        ExportSettings-HideStructureColumns="True" ExportSettings-IgnorePaging="True" 
        ExportSettings-OpenInNewWindow="True" 
         
 >
<MasterTableView DataKeyNames="Name,StartDate,EndDate,DepartmentName,LabourRate,FirstName,LastName,Description,ManagerFirst,ManagerLast,WeekEnding,RateType,TimesheetStatus" 
            DataSourceID="ObjectDataSource1" CommandItemDisplay="Top"
            CommandItemSettings-ShowExportToCsvButton="True" CommandItemSettings-ShowExportToExcelButton="True" CommandItemSettings-ShowExportToPdfButton="True"  CommandItemSettings-ShowExportToWordButton="True" CommandItemSettings-ShowAddNewRecordButton="False" CommandItemSettings-ShowRefreshButton="False" CommandItemStyle-HorizontalAlign="Left"
  
            >
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

    <Columns>
                <telerik:GridBoundColumn DataField="ContractorName" FilterControlWidth="20px" 
            FilterControlAltText="Filter ContractorName column" HeaderText="Contractor" 
            ReadOnly="True" SortExpression="FirstName" UniqueName="ContractorName"  >
        </telerik:GridBoundColumn>

        
        <telerik:GridBoundColumn DataField="Description" 
            FilterControlAltText="Filter Description column" HeaderText="Job" FilterControlWidth="20px" 
            ReadOnly="True" SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>

        <telerik:GridBoundColumn DataField="ManagerName" 
            FilterControlAltText="Filter ManagerName column" HeaderText="Manager" FilterControlWidth="20px" 
            ReadOnly="True" SortExpression="ManagerFirst" UniqueName="ManagerName"  >
        </telerik:GridBoundColumn>


      

       
        <telerik:GridBoundColumn DataField="AgencyRate" DataType="System.Decimal" FilterControlWidth="20px" DataFormatString="{0:C}"
            FilterControlAltText="Filter AgencyRate column" HeaderText="Agency Rate" 
            SortExpression="AgencyRate" UniqueName="AgencyRate">
        </telerik:GridBoundColumn>

        <telerik:GridBoundColumn DataField="LabourRate" DataType="System.Decimal" FilterControlWidth="20px" DataFormatString="{0:C}"
            FilterControlAltText="Filter LabourRate column" HeaderText="Labour Rate" 
            ReadOnly="True" SortExpression="LabourRate" UniqueName="LabourRate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="BillingRate" DataType="System.Decimal" FilterControlWidth="20px" DataFormatString="{0:C}" 
            FilterControlAltText="Filter BillingRate column" HeaderText="Billing Rate" 
            SortExpression="BillingRate" UniqueName="BillingRate">
        </telerik:GridBoundColumn>


       <telerik:GridBoundColumn DataField="StartDate" DataType="System.DateTime" FilterControlWidth="20px" DataFormatString="{0:dd/MM/yyyy}"
            FilterControlAltText="Filter StartDate column" HeaderText="Start" 
            ReadOnly="True" SortExpression="StartDate" UniqueName="StartDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="DepartmentName" 
            FilterControlAltText="Filter DepartmentName column" HeaderText="Department" FilterControlWidth="20px" 
            ReadOnly="True" SortExpression="DepartmentName" UniqueName="DepartmentName"  >
        </telerik:GridBoundColumn>
        
  <telerik:GridBoundColumn DataField="Name" FilterControlWidth="20px" 
            FilterControlAltText="Filter Name column" HeaderText="Name" ReadOnly="True" 
            SortExpression="Name" UniqueName="Name" >
        </telerik:GridBoundColumn>        

        <telerik:GridBoundColumn DataField="Hours" DataType="System.Int32" FilterControlWidth="20px" 
            FilterControlAltText="Filter Hours column" HeaderText="Hours" 
            SortExpression="Hours" UniqueName="Hours">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="RateType" FilterControlWidth="20px" 
            FilterControlAltText="Filter RateType column" HeaderText="RateType" 
            ReadOnly="True" SortExpression="RateType" UniqueName="RateType">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="TimesheetStatus" FilterControlWidth="20px" 
            FilterControlAltText="Filter TimesheetStatus column" 
            HeaderText="Status" ReadOnly="True" SortExpression="TimesheetStatus" 
            UniqueName="TimesheetStatus">
        </telerik:GridBoundColumn>
    </Columns>

<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>

<FilterMenu EnableImageSprites="False"></FilterMenu>
    </telerik:RadGrid>
   

      <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
        SelectMethod="GetPayrollReport" TypeName="Business.PayrollReportList"  
                SortParameterName="sortBy"
        >
          <SelectParameters>
            <asp:SessionParameter SessionField="WeekEnding" DbType="DateTime" Name="WeekEnding" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Dec 2012, 04:30 AM
Hi,

After inspecting your code, I can find that the DataFields ContractorName and ManagerName does not exist in the View's Column. Make sure that the field exist in the database.

Thanks,
Shinu.
0
virender
Top achievements
Rank 1
answered on 28 Dec 2012, 06:56 AM
I think its not matter which is in database, and ContractorName and ManagerName not exists in database. and database source is same for radgrid and MasterTableView .

Please check and help me.


0
Shinu
Top achievements
Rank 2
answered on 02 Jan 2013, 11:50 AM
Hi,

Are you using any code for binding the columns in the server side. Please provide your complete code to understand the issue.

Thanks,
Shinu.
0
virender
Top achievements
Rank 1
answered on 02 Jan 2013, 03:08 PM
No, I not using 
Tags
Grid
Asked by
virender
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
virender
Top achievements
Rank 1
Share this question
or