This is a migrated thread and some comments may be shown as answers.

Cell Expanding

1 Answer 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
FierceMuppet
Top achievements
Rank 1
FierceMuppet asked on 15 Aug 2008, 04:32 PM
I have a grid control where I have a item template.  For some reason, when there are only a few records, the rows are expanded so that the cells fill up the space in the grid.  For example, with 1 record, the one row it almost half of the height.

 
<rad:RadGrid ID="RadGrid1" Skin="Vista" 
    AllowSorting="True" EnableAJAX="True"   
    PageSize="15" ShowFooter="False" AllowPaging="True"   
    AllowMultiRowSelection="False" runat="server"   
    DataSourceID="SDSPendingMailList" 
    GridLines="Both" 
    ShowHeader="false"  HorizontalAlign="Left" 
    Width="350px" 
    > 
     <MasterTableView  Height="300px" AutoGenerateColumns="False" 
        width="350px" 
      ClientDataKeyNames="EmailGUID" DataSourceID="SDSPendingMailList" > 
     <Columns> 
         <rad:GridTemplateColumn UniqueName="TemplateColumn">  
             <ItemStyle Width="350px" Height="80px"/>  
             <ItemTemplate> 
                <div style="width:345px;overflow:hidden">  
                <span style="font-weight:bold; text-decoration:underline;">From:</span> <%#Eval("SenderName")%>&nbsp;<img src="<%#Eval("MatchImage")%>" /><br /> 
                <span style="font-weight:bold; text-decoration:underline;">Sent:</span> <%#Eval("SentDate")%><br /> 
                <span style="font-weight:bold; text-decoration:underline;">Subject:</span> <%#Eval("Subject")%><br /> 
                </div> 
             </ItemTemplate> 
         </rad:GridTemplateColumn> 
     </Columns> 
     <PagerStyle  Position="Top" Mode="NextPrevAndNumeric" VerticalAlign="Middle" /> 
     </MasterTableView> 
        <ClientSettings> 
            <Scrolling AllowScroll="true"  UseStaticHeaders="false"></Scrolling> 
            <Selecting AllowRowSelect="True"></Selecting> 
            <ClientEvents OnRowSelected="RowSelected" /> 
        </ClientSettings> 
    <PagerStyle BorderStyle="None" VerticalAlign="Top" /> 
</rad:RadGrid> 

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 18 Aug 2008, 03:02 PM
Hello,

The problem is caused by the Height setting of MasterTableView. When there are too few table rows, they expand, so that the total height of all rows is equal to the height of the MasterTableView.

Please remove this setting and use ScrollHeight instead:

<ClientSettings>
<Scrolling  AllowScroll="true"  UseStaticHeaders="false"  ScrollHeight="300px" />
</ClientSettings>


Regards,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
FierceMuppet
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or