<!-- Showing in Grid

2 posts, 0 answers
  1. Sean Sparkman
    Sean Sparkman avatar
    6 posts
    Member since:
    Nov 2009

    Posted 03 Feb 2010 Link to this post

    <telerik:RadGrid ID="HeadingsGrid" 
                     runat="server" 
                     DataSourceID="HeadingsSource" 
                     AllowFilteringByColumn="true" 
                     GridLines="None" 
                     AllowSorting="true" 
                     AutoGenerateColumns="false" 
                     BorderStyle="None" 
                     Width="650px" 
                     HorizontalAlign="Center"
        <MasterTableView> 
            <ItemTemplate>             
                <%#IIf(CType(Container, GridItem).ItemIndex = 0, "<table>", "")%>             
                 
                <%#IIf(CType(Container, GridItem).ItemIndex <> 0, "-->", "")%>                                    
                 
                <%#IIf(Eval("category_name") = CurrentCategory, "", "<tr><td colspan=""3"" style=""border: none; text-align: center; font-weight: bold;"">" & SetCategory(Eval("category_name")) & "</td></tr>")%> 
                 
                <%#IIf(Index Mod 3 = 0, "<tr>", "")%> 
                 
                <td style="border: none;" valign="top"
                    <asp:CheckBox ID="HeadingItem" 
                                  runat="server" 
                                  Checked='<%# IsSelected(Eval("Importance"), Eval("Planqty"), Eval("Posn")) %>' 
                                  CssClass='<%# IIf(CType(Container, GridItem).ItemType = GridItemType.Item, "item", "alternatingItem") %>' 
                                  Text='<%#Eval("heading_name")%>' /> 
                </td> 
                 
                <%#IIf(Index Mod 3 = 2, "</tr>", "")%> 
                             
                <%#IncrementIndex(Container)%> 
            </ItemTemplate> 
             
            <Columns> 
                <telerik:GridBoundColumn DataField="category_name" 
                                         HeaderText="Category" 
                                         SortExpression="category_name" 
                                         UniqueName="category_name" /> 
                                          
                <telerik:GridBoundColumn DataField="heading_name" 
                                         HeaderText="Heading" 
                                         SortExpression="heading_name" 
                                         UniqueName="heading_name" /> 
            </Columns> 
        </MasterTableView> 
             
        <GroupingSettings CaseSensitive="true" />     
    </telerik:RadGrid> 
    This probably isn't the prettiest of solutions, but I am working off the ListView Demo for the RadGrid.  I wanted to enhance the demo a little by having section headers.  This "<!--" keeps showing up at the beginning of the grid.

    <input name="HeadingsList$HeadingsGrid$ctl00$ctl02$ctl01$FilterTextBox_category_name" size="10" id="HeadingsList_HeadingsGrid_ctl00_ctl02_ctl01_FilterTextBox_category_name" class="rgFilterBox rfdDecorated" onkeydown="if((event.keyCode == 13 || event.keyCode == 20)) return false;" type="text"><input name="HeadingsList$HeadingsGrid$ctl00$ctl02$ctl01$Filter_category_name" value=" " onclick='$find("HeadingsList_HeadingsGrid")._showFilterMenu("HeadingsList_HeadingsGrid_ctl00", "category_name", event); return false;' id="HeadingsList_HeadingsGrid_ctl00_ctl02_ctl01_Filter_category_name" title="Filter" class="rgFilter" type="submit"></td><td style="white-space: nowrap;"><input name="HeadingsList$HeadingsGrid$ctl00$ctl02$ctl01$FilterTextBox_heading_name" size="10" id="HeadingsList_HeadingsGrid_ctl00_ctl02_ctl01_FilterTextBox_heading_name" class="rgFilterBox rfdDecorated" onkeydown="if((event.keyCode == 13 || event.keyCode == 20)) return false;" type="text"><input name="HeadingsList$HeadingsGrid$ctl00$ctl02$ctl01$Filter_heading_name" value=" " onclick='$find("HeadingsList_HeadingsGrid")._showFilterMenu("HeadingsList_HeadingsGrid_ctl00", "heading_name", event); return false;' id="HeadingsList_HeadingsGrid_ctl00_ctl02_ctl01_Filter_heading_name" title="Filter" class="rgFilter" type="submit"></td> 
            </tr> 
        </thead><tbody
        <tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__0"
            <td colspan="2"
                &lt;!-- 
            <table> 
                <tbody><tr><td colspan="3" style="border: medium none ; text-align: center; font-weight: bold;">Airport Administration</td></tr
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl04_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl04_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl04$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl04_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl04_HeadingItem">Cleaning Service</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__1"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl06_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl06_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl06$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl06_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl06_HeadingItem">Cots / Blankets</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__2"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl08_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl08_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl08$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl08_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl08_HeadingItem">Fuel Cards</label></span
                </td> 
                </tr> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__3"
            <td colspan="2"
                --> 
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl10_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl10_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl10$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl10_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl10_HeadingItem">GPS / Vehicle Locators</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__4"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl12_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl12_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl12$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl12_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl12_HeadingItem">Interior Design</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__5"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl14_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl14_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl14$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl14_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl14_HeadingItem">Inventory Control</label></span
                </td> 
                </tr> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__6"
            <td colspan="2"
                --> 
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl16_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl16_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl16$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl16_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl16_HeadingItem">Noise Abatement / Control</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__7"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl18_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl18_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl18$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl18_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl18_HeadingItem">Office Furniture</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__8"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl20_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl20_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl20$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl20_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl20_HeadingItem">Waste Management</label></span
                </td> 
                </tr> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__9"
            <td colspan="2"
                --> 
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl22_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl22_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl22$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl22_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl22_HeadingItem">Weather Services</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__10"
            <td colspan="2"
                --> 
                </tr><tr><td colspan="3" style="border: medium none ; text-align: center; font-weight: bold;">Airport Revenue</td></tr
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl24_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl24_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl24$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl24_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl24_HeadingItem">Airlines</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__11"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl26_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl26_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl26$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl26_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl26_HeadingItem">Airport Parking</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__12"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl28_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl28_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl28$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl28_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl28_HeadingItem">Apron Management</label></span
                </td> 
                </tr> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__13"
            <td colspan="2"
                --> 
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl30_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl30_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl30$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl30_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl30_HeadingItem">Based Aircraft Billing</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__14"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl32_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl32_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl32$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl32_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl32_HeadingItem">Car Rental</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__15"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl34_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl34_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl34$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl34_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl34_HeadingItem">Fixed Based Operators</label></span
                </td> 
                </tr> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__16"
            <td colspan="2"
                --> 
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl36_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl36_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl36$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl36_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl36_HeadingItem">Food &amp; Beverage</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__17"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl38_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl38_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl38$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl38_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl38_HeadingItem">Landing Fee Billing</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__18"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl40_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl40_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl40$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl40_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl40_HeadingItem">Medical Services</label></span
                </td> 
                </tr> 
                <!-- 
            </td> 
        </tr><tr class="rgAltRow" id="HeadingsList_HeadingsGrid_ctl00__19"
            <td colspan="2"
                --> 
                <tr> 
                <td style="border: medium none ;" valign="top"
                    <span class="alternatingItem"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl42_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl42_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl42$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl42_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl42_HeadingItem">Restaurants</label></span
                </td> 
                <!-- 
            </td> 
        </tr><tr class="rgRow" id="HeadingsList_HeadingsGrid_ctl00__20"
            <td colspan="2"
                --> 
                <td style="border: medium none ;" valign="top"
                    <span class="item"><input class="rfdRealInput" _rfddecoratedid="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl44_HeadingItem" id="HeadingsList_HeadingsGrid_ctl00_ctl44_HeadingItem" name="HeadingsList$HeadingsGrid$ctl00$ctl44$HeadingItem" type="checkbox"><label class=" rfdCheckboxUnchecked" id="_rfdSkinnedHeadingsList_HeadingsGrid_ctl00_ctl44_HeadingItem" for="HeadingsList_HeadingsGrid_ctl00_ctl44_HeadingItem">Retail Stores</label></span
                </td> 
    I just wanted to get rid of the &lt;-- at the beginning

  2. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 04 Feb 2010 Link to this post

    Hi Sean,

    Your code snippet is not runnable, because the code behind is missing.

    However, the problem is in the fact that the first opening comment is escaped. You need to investigate why this happens.

    "&lt;!--" should be rendered as "<!--"

    Actually, I am not sure that the HTML output is valid and that the comment rendering logic is correct. You may want to look into that as well.

    Regards,
    Dimo
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top