日期:2014-05-17  浏览次数:20554 次

asp.net GridView实现树形结构问题

上面的图看:最后一列是空的,也是我不想这一列。我怎么才能让着列不显示,并且不影响正常树形结构的显示。谢谢 急啊!源码如下

<asp:GridView ID="gvItem" Width="600px" OnRowDataBound="gvItem_RowCommand" DataKeyNames="ID"
                    runat="server" AutoGenerateColumns="False">
                    <Columns> 
                        <asp:TemplateField>
                            <ItemStyle Width="1%" />
                            <ItemTemplate>
                                <%-- 
                              <span id='btnShowHidden<%#Eval("id") %>' style="float: right; color: Red; cursor: pointer;
                                    margin: 0 0 0 0" onclick="ShowHidden('<%#Eval("id") %>',event)">展开列表</span> --%>
                              <img id='img<%#Eval("id")%>' style="border: 0px; padding-left: 20px;" src="Image/maximize.gif" onclick="ShowHidden('<%#Eval("id") %>',event)" />
                            </ItemTemplate>
                        </asp:TemplateField>