RadGrid/ItemTemplate/Table/Panels

1 posts, 0 answers
  1. Patrick
    Patrick avatar
    1 posts
    Member since:
    May 2017

    Posted 22 May Link to this post

    Hello,

    First off I hope I am explaining this correctly.

    I would like to know how to put multiple panels within a RadGrid.  I have a GridTemplateColumn that contains an ItemTemplate.  In the ItemTemplate I have a table that has several table rows.  I would like to put one panel for certain rows another panel for a second set of specific rows and so on until I get to the ending tag of the table.  I want to do this because I want to hide and show certain parts of the table based on a setting selected by the user.  From my example below you can see that I did a test on one row of the first part of the table.  I can hide or show that panel.  However when I try and do this for the other parts of the table it does not work.  In fact it seems stop the creation/display of the rest of the asp code starting with the panel tag.

    So if I had a table row with "Blah"  and then a panel and in that a table row with "Blah Two" with the ending panel tag then only Blah would show regardless of how I set the state of the panel. 

    I would think I could put panels within a table within a RadGrid.  However I am somewhat new to Telerik and am not sure I am doing this correctly.  The end result of what I want to do is create a RadGrid with sections that I can hide certain values based on user input that can ultimately be displayed in PDF form.  I think that if I get past the panel issue then the PDF aspect should fall into place.

     

    Here is my example - Can anyone help?   Thanks Patrick

     

     

     

        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
            ClientEvents-OnRequestStart="requestStart">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" DataSourceID="SqlDataSource1"
            AllowSorting="false"   Width="1200px" AllowPaging="True" AutoGenerateColumns="False"  AllowAutomaticInserts="false"  ExportSettings-ExportOnlyData="False" ExportSettings-HideStructureColumns="False" ExportSettings-IgnorePaging="False" MasterTableView-HierarchyDefaultExpanded="False">
            <ExportSettings  ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true"   >
                <Pdf PageHeight="600mm" PageWidth="297mm" PageTitle="CTFP Nomination" DefaultFontFamily="Arial Unicode MS"
                    PageBottomMargin="20mm" PageTopMargin="20mm" PageLeftMargin="20mm" PageRightMargin="20mm" FontType="Subset"  >
                </Pdf>
            </ExportSettings>
            <MasterTableView CommandItemDisplay="Top" DataSourceID="SqlDataSource1" DataKeyNames="masl_id"
                PageSize="4" TableLayout="Fixed">
         
                <CommandItemTemplate>
     <asp:Button ID="DownloadPDF" runat="server" Width="100%" CommandName="ExportToPdf"
     CssClass="pdfButton"></asp:Button>
     
                </CommandItemTemplate>
          
                <Columns>
        
                    <telerik:GridTemplateColumn   ItemStyle-ForeColor="Black">
               
                        <ItemTemplate>
                            <table  style="width: 727px; height: 100%" border="0">
                             <colgroup>
                                        <col />
                                        <col />
                                        <col />
                                        <col />
                                        <col />
                                        <col />
                                        <col />
                                    </colgroup>
                                <asp:Panel ID="pntest" runat="server" Visible =" true">
                                <tr align="center"  >
                               <%-- style="background-position: center center; width: 1200px; background-image:url('../../images/watermark2.png'); background-repeat: no-repeat;"--%>
                                    <td colspan="8">
                                       <b><font size="5" color="black">MASL Detail Report for MASL ID: <%# Eval("masl_id")%></font> </b>
                                     
                                        <br/><br/><br/><br/>
                                    </td>
                                </tr>
                                </asp:Panel>
                                <%--<asp:Panel ID="Panel1" runat="server" Visible =" true">--%>
                                <tr align="left" >
                                      <td colspan="8" class="auto-style1">
                                        <asp:Label ID="Label3" runat="server" Text="MASL ID: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <asp:Label ID="Label4" runat="server" Text='<%# Eval("masl_id") %>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                          &nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:Label ID="Label5" runat="server" Text="Course Title: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <asp:Label ID="Label6" runat="server" Text='<%# Eval("title") %>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                     
                                         <br/><br/>
                                    </td>
                                </tr>
                                 <%--</asp:Panel>--%>
                                <tr align="left" >
                                    <td colspan="8" class="auto-style1">
                                       
                                         
                                         <asp:Label ID="Label7" runat="server" Text="Effective Date: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label8" runat="server" Text='<%# fDateCheck(DataBinder.Eval(Container.DataItem, "masl_fy").ToString.Trim)%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label9" runat="server" Text="Expiration Date: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label10" runat="server" Text='<%# fDateCheck(DataBinder.Eval(Container.DataItem, "exp_date").ToString.Trim)%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>--%>
                                          &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label11" runat="server" Text="Duration: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label12" runat="server" Text='<%# Eval("dur")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>     --%>
                                        
                                         <br/><br/>
                                    </td>
                                </tr>

                                <tr align="left" >
                                     <td colspan="7" class="auto-style1">
                                        <asp:Label ID="Label23" runat="server" Text="Course Number: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label24" runat="server" Text='<%# Eval("c_id_no")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:Label ID="Label25" runat="server" Text="DSAMS ID: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label26" runat="server" Text='<%# Eval("DSAMS???") %>' Style="font-size: 13px; /*Not sure what this should be*/
                                            color:Black; font-weight: bold;"></asp:Label>   --%>
                                          &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label27" runat="server" Text="IA: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label28" runat="server" Text=' <%# Eval("ia")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label29" runat="server" Text="Security: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label30" runat="server" Text='<%# Eval("Security")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>--%>
                                          &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label31" runat="server" Text="E-IMET: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label32" runat="server" Text='<%# Eval("eimet")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>   --%> 
                                        
                                         <br/><br/>
                                    </td>
                                </tr>

                                <tr align="left" >
                                     <td colspan="7" class="auto-style1">
                                        <asp:Label ID="Label33" runat="server" Text="Analysis Code: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label34" runat="server" Text='<%# Eval("anal_code")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:Label ID="Label35" runat="server" Text="Location Code: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label36" runat="server" Text='<%# Eval("DSAMS???") %>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>   --%>
                                          &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label37" runat="server" Text="Waiver: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label38" runat="server" Text=' <%# Eval("ia")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label39" runat="server" Text="Team Type: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label40" runat="server" Text='<%# Eval("Security")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>--%>
                                         
                                         <br/><br/>
                                    </td>
                                </tr>
                                <tr align="left" >
                                     <td colspan="7" class="auto-style1">
                                        <asp:Label ID="Label41" runat="server" Text="Penalty Rate: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label42" runat="server" Text='<%# Eval("c_id_no")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:Label ID="Label43" runat="server" Text="Sensitive: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label44" runat="server" Text='<%# Eval("DSAMS???") %>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>  --%>
                                          &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label45" runat="server" Text="Phase: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label46" runat="server" Text=' <%# Eval("ia")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label47" runat="server" Text="CDP-ID: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label48" runat="server" Text='<%# Eval("Security")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>--%>
                                         
                                         <br/><br/>
                                    </td>
                                </tr>
                                <tr align="left" >
                                     <td colspan="7" class="auto-style1">
                                        <asp:Label ID="Label49" runat="server" Text="Language Requirements: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label50" runat="server" Text='<%# Eval("c_id_no")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                        <asp:Label ID="Label51" runat="server" Text="ECL:" Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label52" runat="server" Text='<%# Eval("DSAMS???") %>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>   --%>
                                          &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label53" runat="server" Text="OPI: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label54" runat="server" Text=' <%# Eval("ia")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label55" runat="server" Text="Set: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                       <%--  <asp:Label ID="Label56" runat="server" Text='<%# Eval("Security")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>--%>
                                         &nbsp;&nbsp;&nbsp;&nbsp;
                                         <asp:Label ID="Label57" runat="server" Text="GRE: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label58" runat="server" Text='<%# Eval("Security")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>--%>
                                         
                                         <br/><br/>
                                    </td>
                                </tr>

                                <tr align="left" >
                                    
                                     <td colspan="7" class="auto-style1">
                                        <asp:Label ID="Label59" runat="server" Text="Course Description: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                        <%-- <asp:Label ID="Label60" runat="server" Text='<%# Eval("c_id_no")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                      
                                       
                                         <br/><br/> <br/><br/> <br/><br/>
                                    </td>
                                </tr>
                                <tr align="left" >
                                     <td colspan="7" class="auto-style1">
                                      
                                       
                                           <asp:Label ID="Label61" runat="server" Text="Key Lessons: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label62" runat="server" Text='<%# Eval("DSAMS???") %>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>   --%>
                                        
                                         <br/><br/>
                                    </td>
                                </tr>
                                  <tr align="left" >
                                     <td colspan="7" class="auto-style1">
                                      
                                         <asp:Label ID="Label63" runat="server" Text="Course Prerequisite Text: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                         <%--<asp:Label ID="Label64" runat="server" Text=' <%# Eval("ia")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label> --%>
                                       
                                       
                                         <br/><br/>
                                    </td>
                                </tr>
                                <tr align="left" >
                                     <td colspan="7" class="auto-style1">
                                  
                                         <asp:Label ID="Label65" runat="server" Text="International Notes: " Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>
                                       <%--  <asp:Label ID="Label66" runat="server" Text='<%# Eval("Security")%>' Style="font-size: 13px;
                                            color:Black; font-weight: bold;"></asp:Label>--%>
                                       
                                         <br/><br/>
                                    </td>
                                </tr>
                           
                            </table>
                        </ItemTemplate>


                    </telerik:GridTemplateColumn>
                    
                </Columns>
            </MasterTableView>
            <HeaderStyle HorizontalAlign="Center" Font-Size="16px"></HeaderStyle>
            <ItemStyle HorizontalAlign="Left" Font-Names="Arial, Segoe UI, sans-serif;" Font-Size="12px"
                ForeColor="#eeeeee"></ItemStyle>
            <AlternatingItemStyle HorizontalAlign="Left" Font-Names="Arial, Segoe UI, sans-serif;" Font-Size="12px"
                ForeColor="#eeeeee"></AlternatingItemStyle>
        </telerik:RadGrid>

     

Back to Top