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

NestedViewTemplate In Hierarchy Grid

5 Answers 276 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 14 May 2008, 02:53 PM
Is it possible to have a NestedViewTemplate in a hierachy grid?  I started out with a hiearchy grid, then added some detailviews in my hierarchy grid and lost all my hiearchy levels.  The '>' arrow to expand the selection is now a selection to view the details and not to view records underneath the parant record.

Thx~

5 Answers, 1 is accepted

Sort by
0
Steve
Top achievements
Rank 1
answered on 14 May 2008, 03:35 PM
Additional Info:  Seems like the NestedViewTemplate only works in the lowest level of the hierarchy, is there something I have set up incorrectly?
0
Steve
Top achievements
Rank 1
answered on 14 May 2008, 09:04 PM
I ended up putting another RadGrid inside my NestedViewTemplate.  So essentially I have 1 MasterView, inside that I have the nested view (to show the details of the item).  Inside this nested view, I have another RadGrid with a masterview and detail table.

The problem I am now seeing is there is no relationship between my 2 masterviews.  Is there anyway to have a relationship?

S~
0
Steve
Top achievements
Rank 1
answered on 14 May 2008, 09:10 PM
So I have 2 questions above...
0
Joe Loux
Top achievements
Rank 1
answered on 15 May 2008, 06:53 PM
I've been having the same issues.  I'll let you know if I figure it out.
0
DragonBall
Top achievements
Rank 1
answered on 30 Jul 2008, 08:38 AM
Im not so sure about this.

<
%@ Control Language="C#" AutoEventWireup="true" CodeFile="MeetingNotes.ascx.cs" Inherits="Project_MeetingNotes" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %> 
<link rel="stylesheet" type="text/css" href="StyleSheet.css" /> 
<asp:SqlDataSource ID="SqlDSProjectMeetings" runat="server"  
    ConnectionString="<%$ ConnectionStrings:MeetWebStyleConnectionString %>"  
    SelectCommand="MWS_Meetings_GetByProject_id"  
    SelectCommandType="StoredProcedure"
    <SelectParameters> 
        <asp:QueryStringParameter DefaultValue="2" Name="Project_id"  
            QueryStringField="project_id" Type="Int32" /> 
    </SelectParameters> 
</asp:SqlDataSource> 
<asp:SqlDataSource ID="SqlDSMeetingNotes" runat="server"  
    ConnectionString="<%$ ConnectionStrings:MeetWebStyleConnectionString %>"  
    SelectCommand="MWS_Meeting_notes_GetByMeeting_id"  
    SelectCommandType="StoredProcedure" InsertCommandType="StoredProcedure" InsertCommand="meeting_id"
    <SelectParameters> 
        <asp:ControlParameter ControlID="RadGrid1" DefaultValue="7" Name="Meeting_id"  
            PropertyName="SelectedValue" Type="Int32" /> 
             <%--<asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="meeting_id" />--%> 
    </SelectParameters> 
    <InsertParameters> 
          <asp:ControlParameter ControlID="RadGrid1" DefaultValue="7" Name="Meeting_id"  
          PropertyName="SelectedValue" Type="Int32" /> 
    </InsertParameters> 
     
     
</asp:SqlDataSource> 
<asp:SqlDataSource ID="SqlDSMeetingAgenda" runat="server"  
    ConnectionString="<%$ ConnectionStrings:MeetWebStyleConnectionString %>"  
    SelectCommand="MWS_Meeting_agenda_GetByMeeting_id"  
    SelectCommandType="StoredProcedure" InsertCommandType="Text"
    <SelectParameters> 
        <asp:ControlParameter ControlID="RadGrid1" DefaultValue="2" Name="Meeting_id"  
            PropertyName="SelectedValue" Type="Int32" /> 
    </SelectParameters> 
</asp:SqlDataSource> 
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server"
</telerik:RadScriptManager> 
 
 
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="RadGrid1"
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
<asp:Label ID="Label3" Font-Bold="true" Font-Italic="true" Text='<%# Eval("meetings_id") %>' Visible="false" runat="server" /> 
<asp:Label ID="Label4" Font-Bold="true" Font-Italic="true" Text='<%# Eval("meetings_id") %>' Visible="false" runat="server" /> 
<telerik:RadGrid ID="RadGrid1" runat="server"  
    DataSourceID="SqlDSProjectMeetings" 
    GridLines="None" AllowPaging="True" AutoGenerateColumns="False"  
    onitemupdated="RadGrid1_ItemUpdated" AllowCustomPaging="True"  
    Skin="Office2007" AllowFilteringByColumn="True" EnableEmbeddedSkins="True" 
    onneeddatasource="RadGrid1_NeedDataSource" 
    CommandItemStyle-CssClass="GridCommandRow_Office2007" 
    PagerStyle-CssClass="sliderPagerLabel_Office2007"  
    onitemcommand="RadGrid1_ItemCommand" oniteminserted="RadGrid1_ItemInserted"
<PagerStyle CssClass="sliderPagerLabel_Office2007"></PagerStyle> 
 
    
 
<MasterTableView commanditemdisplay="Top" datasourceid="SqlDSProjectMeetings"  
        editmode="PopUp" AllowPaging="true" AutoGenerateColumns="False"  
        Font-Bold="False" Font-Italic="False" Font-Overline="False"  
        Font-Strikeout="False" Font-Underline="False"
  <NestedViewTemplate> 
   
     
 
     
    <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("meetings_id") %>' Visible="false" runat="server" /> 
         
     
   <asp:SqlDataSource ID="SqlDSMeetingNotes" runat="server"  
        ConnectionString="<%$ ConnectionStrings:MeetWebStyleConnectionString %>"  
        SelectCommand="MWS_Meeting_notes_GetByMeeting_id"  
        SelectCommandType="StoredProcedure"  
        InsertCommandType="StoredProcedure" InsertCommand="MWS_Meeting_notes_Insert"  
        UpdateCommandType="StoredProcedure" UpdateCommand="MWS_Meeting_notes_Update"
       
        <SelectParameters> 
            <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="meeting_id" /> 
        </SelectParameters> 
        <UpdateParameters> 
            <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="meeting_id" /> 
        </UpdateParameters> 
 
    </asp:SqlDataSource> 
                                
    
    
    <telerik:RadGrid ID="RAD1" runat="server" GridLines="None" AllowFilteringByColumn="True"  
            AllowPaging="True" PageSize="5" AllowSorting="True" Width="100%" AutoGenerateColumns="False" 
            ShowStatusBar="False" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" 
            AllowAutomaticUpdates="True"  DataSourceID="SqlDSMeetingNotes" HorizontalAlign="NotSet" Skin="Office2007" onitemupdated="RadGrid1_ItemUpdated" > 
   
    <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="meeting_id" AllowAutomaticInserts="True" 
            AllowAutomaticUpdates="True" EditFormSettings-PopUpSettings-Width="800px" DataSourceID="SqlDSMeetingNotes"
    <GroupHeaderItemStyle /> 
     
    <Columns> 
        <telerik:GridEditCommandColumn UniqueName="EditColumn" /> 
            <telerik:GridHTMLEditorColumn 
             UniqueName="meeting_note_text" 
             DataField="meeting_note_text" 
             HeaderText="Notes" EditFormColumnIndex="1" /> 
            <telerik:GridDropDownColumn DataField="meeting_note_id" 
              UniqueName="meeting_note_id" 
             ListTextField="meeting_note_id" 
             DataSourceID="SqlDSMeetingNotes" 
             HeaderText="ID" 
             DropDownControlType="RadComboBox" Resizable="true" EditFormColumnIndex="0" /> 
             <telerik:GridDropDownColumn DataField="user_id" 
             UniqueName="user_id" 
             ListTextField="user_id" 
             DataSourceID="SqlDSMeetingNotes" 
             HeaderText="USER ID" 
             Display="false" 
             DropDownControlType="RadComboBox" Resizable="true" EditFormColumnIndex="0" />  
    </Columns> 
    <EditFormSettings ColumnNumber="3" CaptionFormatString="Edit Meeting Details with Meeting {0}" CaptionDataField="meeting_id"  EditFormType="Template"
    
    <FormTemplate> 
        
    <table style="width: 171px"
    <tbody> 
     <tr> 
      <td> 
        <asp:TextBox ID="TextBox2" runat="server" 
       Text='<%# Bind("meeting_note_id") %>'></asp:TextBox> 
 
      </td> 
      <td> 
          <asp:TextBox ID="TextBox1" runat="server" 
       Text='<%# Bind("meeting_note_text") %>'></asp:TextBox> 
 
      </td> 
     </tr> 
     <tr> 
     <td> 
      <asp:TextBox ID="TextBox3" runat="server" 
       Text='<%# Bind("user_id") %>'></asp:TextBox> 
     </td> 
     </tr> 
        <tr> 
         <td align="right" colspan="2"
            <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
            </asp:Button>&nbsp; 
            <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" 
            CommandName="Cancel"></asp:Button></td
    </tr> 
     </tbody> 
     </table>    
         
         
         
    </FormTemplate> 
    </EditFormSettings> 
    </MasterTableView> 
     </telerik:RadGrid> 
  </NestedViewTemplate> 
   
     
 
    <CommandItemSettings AddNewRecordImageUrl="AddRecord.gif"  
        RefreshImageUrl="Refresh.gif" /> 
   
     
 
<RowIndicatorColumn Visible="False"><HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
    <ExpandCollapseColumn Visible="False" Resizable="False"  
        CollapseImageUrl="SingleMinus.gif" ExpandImageUrl="SinglePlus.gif"  
        FilterImageUrl="Filter.gif" SortAscImageUrl="SortAsc.gif"  
        SortDescImageUrl="SortDesc.gif"><HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridBoundColumn DataField="meetings_id" HeaderText="Meeting ID"  
            UniqueName="column" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="project_id" HeaderText="Project ID"  
            UniqueName="column1" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="meeting_title" HeaderText="Title"  
            UniqueName="column2" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="start_date" HeaderText="Starting Date"  
            UniqueName="column3" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="end_date" HeaderText="End Date"  
            UniqueName="column4" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="meeting_speaker_id" HeaderText="Speaker"  
            UniqueName="column5" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="recurrenceRule" HeaderText="Rule"  
            UniqueName="column6" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="recurrenceParentID" HeaderText="Rule ID"  
            UniqueName="column7" FilterImageUrl="Filter.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"
        </telerik:GridBoundColumn> 
    </Columns> 
    <EditFormSettings> 
        <EditColumn CancelImageUrl="Cancel.gif" EditImageUrl="Edit.gif"  
            FilterImageUrl="Filter.gif" InsertImageUrl="Update.gif"  
            SortAscImageUrl="SortAsc.gif" SortDescImageUrl="SortDesc.gif"  
            UpdateImageUrl="Update.gif"
        </EditColumn> 
        <PopUpSettings ScrollBars="None"></PopUpSettings> 
</EditFormSettings> 
    <GroupHeaderItemStyle Font-Bold="False" Font-Italic="False"  
        Font-Overline="False" Font-Strikeout="False" Font-Underline="False"  
        ForeColor="Black" Wrap="True" /> 
    <PagerStyle FirstPageImageUrl="PagingFirst.gif"  
        LastPageImageUrl="PagingLast.gif" NextPageImageUrl="PagingNext.gif"  
        PrevPageImageUrl="PagingPrev.gif" /> 
    <HeaderStyle BackColor="Black" Font-Bold="False" Font-Italic="False"  
        Font-Overline="False" Font-Strikeout="False" Font-Underline="False"  
        ForeColor="Black" Wrap="True" /> 
</MasterTableView> 
    <HeaderStyle ForeColor="Brown" /> 
 
<CommandItemStyle CssClass="GridCommandRow_Office2007"></CommandItemStyle> 
 
</telerik:RadGrid> 
 

Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Steve
Top achievements
Rank 1
Joe Loux
Top achievements
Rank 1
DragonBall
Top achievements
Rank 1
Share this question
or