在属性窗囗设置Height=0px,就可以了,不过拖拉过以后,可能还要再重新设置,试试吧

解决方案 »

  1.   

    楼上说的是啊!
    把Height属性值设为0,就OK了
      

  2.   

    在Datagrid的属性栏中有个样式,可以在那里进行设定,不时有Headerstyle标头样式,itemstyle选择区样式,把里头的height属性设定好后,绑定出来就不会出现你说
    的情况了
    下面是我设定的
    <asp:datagrid id="My_grid" runat="server" Width="500px" BorderWidth="1px" BorderColor="Gray" DataKeyField="id"
    PageSize="6" AllowPaging="True" AutoGenerateColumns="False" OnEditCommand="My_grid_Edit">
    <SelectedItemStyle HorizontalAlign="Center" Height="20px" VerticalAlign="Middle"></SelectedItemStyle>
    <AlternatingItemStyle Font-Size="12px" HorizontalAlign="Center" Height="20px" BackColor="White"></AlternatingItemStyle>
    <ItemStyle Font-Size="12px" HorizontalAlign="Center" Height="20px"></ItemStyle>
    <HeaderStyle Font-Size="13px" HorizontalAlign="Center" Height="20px" BackColor="Silver"></HeaderStyle>
    <Columns>
    <asp:BoundColumn DataField="T_Str_lxmc" HeaderText="素材类型">
    <HeaderStyle Width="110px"></HeaderStyle>
    </asp:BoundColumn>
    <asp:BoundColumn DataField="T_Str_Zlxmc" HeaderText="素材子类型">
    <HeaderStyle Width="110px"></HeaderStyle>
    </asp:BoundColumn>
    <asp:TemplateColumn HeaderText="素材名称">
    <HeaderStyle Width="120px"></HeaderStyle>
    <ItemTemplate>
    <a href="scnr.aspx?id=<%# DataBinder.Eval(Container.DataItem,"ID")%>" onclick="return pop(this,href)">
    <%# DataBinder.Eval(Container.DataItem,"T_Str_Scmc","{0:d}")%>
    </a>
    </ItemTemplate>
    </asp:TemplateColumn>
    <asp:BoundColumn DataField="T_Str_Scyt" HeaderText="素材用途">
    <HeaderStyle Width="110px"></HeaderStyle>
    </asp:BoundColumn>
    <asp:ButtonColumn CommandName="Edit" FooterText="下载" Text="下载" HeaderStyle-Width="50px"></asp:ButtonColumn>
    </Columns>
    <PagerStyle VerticalAlign="Middle" Height="20px" Font-Size="30px" Font-Names="新宋体" Font-Bold="True"
    HorizontalAlign="Center" Mode="NumericPages"></PagerStyle>
    </asp:datagrid>