views:

1597

answers:

2

Hi.

I have placed an AJAX Tabcontrol on my page.

Inside the TabControl, I also placed a gridview.

<cc1:TabContainer id="tabconLandTransPlan" runat="server" Height="300px" ActiveTabIndex="0" AutoPostBack="True">
<cc1:TabPanel runat="server" ID="tabMasterPlan" HeaderText="Master Plan" >
 <HeaderTemplate>
  <span style="font-size: 8pt; font-family: Arial">Master Plan</span>
 </HeaderTemplate>
 <ContentTemplate>
  <asp:GridView id="gvBuffer" runat="server" Width="100%" AutoGenerateColumns="False">
   <Columns>
    <asp:TemplateField HeaderText="Type of Services">
     <HeaderStyle Width="26%"></HeaderStyle>
     <ItemTemplate>
      <asp:Label id="Label1" runat="server" Text='<%# EVAL("code_desc") %>'></asp:Label> 
     </ItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField HeaderText="Tariff Code">
     <HeaderStyle Width="4%" HorizontalAlign="Center"></HeaderStyle>
     <ItemStyle HorizontalAlign="Center"></ItemStyle>
     <ItemTemplate>
      <asp:Label ID="Label2" runat="server" Text='<%# EVAL("res_code") %>'></asp:Label>
     </ItemTemplate>
    </asp:TemplateField>
   </Columns>
  </asp:GridView> 
 </ContentTemplate>
</cc1:TabPanel>

When I retrieve the gridview, the gridview boundaries extend beyond the Tab Control boundaries. How Can I ensure that the gridview will be just within the boundaries of the tab control? The height of the Gridview is extending beyond the tab control. The width is just fine.

Thanks.

A: 

Increase the height of the tab control!

Cyril Gupta
+1  A: 

I may have found the answer to this little problem.

Apparently, the ajax tab control follows the size (height) of the controls inside it.

So what I did was set the height of the tabcontrol to Nothing (VB.Net).

Setting it to zero or any other percentage (conversion) values would otherwise throw an error.

Thanks to those who viewed.

Batuta
Please, show sample code.
Phil