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

RadGrid in a Hierarchy with multiple table in Dynamic Data

6 Answers 159 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen Naughton
Top achievements
Rank 1
Stephen Naughton asked on 15 Sep 2010, 02:03 PM
Hi Is it possilbe to use the RadGrid in a Hierarchy with multiple table in Dynamic Data, as I seem to have issues
<telerik:DynamicRadGrid 
    ID="RadGrid1" 
    runat="server" 
    AllowPaging="True" 
    AllowSorting="True"
    AutoGenerateDeleteColumn="true" 
    AutoGenerateEditColumn="true"
    AutoGenerateColumns="false" 
    DataSourceID="ProjectsDataSource"
    GridLines="Vertical" 
    Skin="Windows7">
    <MasterTableView DataKeyNames="PKID" DataSourceID="ProjectsDataSource" AutoGenerateColumns="false">
        <Columns>
            <telerik:DynamicGridBoundColumn DataField="ProjectState" HeaderText="Project State" />
            <telerik:DynamicGridBoundColumn DataField="ProjectNumber" HeaderText="Project #"/>
            <telerik:DynamicGridBoundColumn DataField="ACModel" HeaderText="AC Model" />
            <telerik:DynamicGridBoundColumn DataField="Name" />
            <telerik:DynamicGridBoundColumn DataField="CustomerLocation" HeaderText="Customer Location" />
            <telerik:DynamicGridBoundColumn DataField="Description" />
        </Columns>
        <DetailTables>
            <telerik:GridTableView runat="server" DataKeyNames="PKID" DataSourceID="PhasesDataSource" AutoGenerateColumns="false">
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="Project_FKID" MasterKeyField="PKID" />
                </ParentTableRelation>
                <Columns>
                    <telerik:DynamicGridBoundColumn DataField="Description" HeaderText="Description" />
                    <telerik:DynamicGridBoundColumn DataField="HourlyRate" HeaderText="Hourly Rate" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateHours" HeaderText="Estimate Hours" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateTotal" HeaderText="Estimate Total" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateStartDate" HeaderText="Estimate Start Date" />
                    <telerik:DynamicGridBoundColumn DataField="EstimateCompletionDate" HeaderText="Estimate Completion Date" />
                    <telerik:DynamicGridBoundColumn DataField="ActualStartDate" HeaderText="Actual Start Date" />
                    <telerik:DynamicGridBoundColumn DataField="ActualCompletionDate" HeaderText="Actual Completion Date" />
                    <telerik:DynamicGridBoundColumn DataField="EngineeringAuthorizations" HeaderText="Engineering Authorizations" />
                    <telerik:DynamicGridBoundColumn DataField="EngineeringType" HeaderText="Engineering Type" />
                    <telerik:DynamicGridBoundColumn DataField="PhaseState" HeaderText="Phase State" />
                    <telerik:DynamicGridBoundColumn DataField="PhaseType" HeaderText="Phase Type" />
                </Columns>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:DynamicRadGrid>
  
<asp:LinqDataSource ID="ProjectsDataSource" runat="server" EnableDelete="true">
    <WhereParameters>
        <asp:DynamicControlParameter ControlId="FilterRepeater" />
    </WhereParameters>
</asp:LinqDataSource>
<asp:LinqDataSource ID="PhasesDataSource" runat="server" ContextTypeName="DD_EPC.Models.EPCDataContext"
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Phases">
</asp:LinqDataSource>
<asp:LinqDataSource ID="TasksDataSource" runat="server" ContextTypeName="DD_EPC.Models.EPCDataContext"
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Tasks">
</asp:LinqDataSource>
 When I try this I get the following error
 

Server Error in '/' Application.

The table 'Projects' does not have a column named 'HourlyRate'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Which suggests that the GridTableView is not recognising the DynamicGridBoundColumns I have added. All works fine if I remove the GridTableView Coluns section but I get no DD field templates in the nested grid.

6 Answers, 1 is accepted

Sort by
0
Stephen Naughton
Top achievements
Rank 1
answered on 16 Sep 2010, 09:29 AM
A second issue I am having with the above is even though I have AutoGenerateColumns="false" columns in the Master table are being generated and I have duplicates to of the column specified in the Columns collection.

Also this is VS2008 .Net 3.5 SP1 NOT VS2010 .Net 4
0
Stephen Naughton
Top achievements
Rank 1
answered on 20 Sep 2010, 01:33 PM
Any ideas guys please?
0
Iana Tsolova
Telerik team
answered on 20 Sep 2010, 02:31 PM
Hello Stephen,

I reviewed the provided code and I can see your grid is properly configured. Can you specify when exactly the error occurs?
I also observed that the HourlyRate data field is used for the detail table. Therefore is should not be looked for in the MasterTableView data source. Can you confirm that the HourlyRate data field is not used by any means in the MasterTableView structure?

Greetings,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Stephen Naughton
Top achievements
Rank 1
answered on 20 Sep 2010, 02:55 PM
Hi Iana, the error occurs when the page is first encountered :(
0
Stephen Naughton
Top achievements
Rank 1
answered on 20 Sep 2010, 09:21 PM
Please remember Iana, that this is a Dynamic Data .Net 3.5 project using your addition for Dynamic Data re the DynamicRadGrid
(I canged the tag name to telerik from dynamic for clarity)
0
Iana Tsolova
Telerik team
answered on 21 Sep 2010, 10:25 AM
Hi Stephen,

In this case I would ask you to open a formal support ticket and send us a runnable sample. We will debug it locally and thus find the source of the problem and a suitable resolution.

All the best,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Stephen Naughton
Top achievements
Rank 1
Answers by
Stephen Naughton
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or