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

RadGrid Height set to 300px by default

2 Answers 891 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lynn
Top achievements
Rank 2
Lynn asked on 21 May 2011, 03:05 PM
After submitting this request, I kept searching your knowledge base, forums, etc. and found a solution to my problem -- turning off the auto scroll setting.  What an idiot I am!

You may close this item now.  I'm a happy camper.  My apologies for mucking up the works with this one!

I have a RadGrid that I need to grow vertically with content.  If I do not set a height, it always defaults to 300px.  I have attached or included several items for you to review.  Using the IE Developer Tools, I have turned off the default 300px height setting and the grid behaves exactly the way I want it to.

First the definition of the grid:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" EnableEmbeddedSkins="true" Skin="Default" ShowHeader="false"
     AllowPaging="True" PageSize="5" GridLines="Horizontal" >
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView >
        <Columns>
            <telerik:GridTemplateColumn UniqueName="TemplateColumn1" >
                <ItemTemplate>
                    <table width="155px">
                        <tr>
                            <td >
                                <asp:Image ID="Image1" Style="float: left;" Width="150px" Height="100px" ImageUrl='<%# Eval("PicturePath")%>'
                                    BorderWidth="1px" runat="server" AlternateText="Stock Image" />
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Center" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="TemplateColumn2" >
                <ItemTemplate>
                    <table>
                        <tr>
                            <td>
                                <div>
                                    <ul>
                                        <li>
                                            <label><b>Address: </b></label><%# Eval("ListingStreetAddress")%>
                                        </li>
                                        <li>
                                            <label><b>Beds: </b></label><%# Eval("Bedrooms")%>
                                        </li>
                                        <li>
                                            <label><b>Baths: </b></label><%# Eval("Bathrooms")%>
                                        </li>
                                        <li>
                                            <label><b>Price: </b></label><%# Eval("ListingPrice", "{0:##,##0.00}")%>
                                        </li>
 
                                        <li>
                                            <label><b>City: </b></label><%# Eval("CityName")%>
                                        </li>
                                        <li>
                                            <label><b>State: </b></label><%# Eval("StateName")%>
                                        </li>
                                        <li>
                                            <label><b>Country: </b></label><%# Eval("CountryName")%>
                                        </li>
 
 
                                    </ul>
                                </div>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="Lat1" DataField="Lat1" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="Long1" DataField="Long1" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="TblName" DataField="TblName" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ListingStreetAddress" DataField="ListingStreetAddress" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="CityName" DataField="CityName" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="StateName" DataField="StateName" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="CountryName" DataField="CountryName" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ListingPlannedCommName" DataField="ListingPlannedCommName" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ListingSubdivision" DataField="ListingSubdivision" Visible="false"></telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ListingZipPostalCode" DataField="ListingZipPostalCode" Visible="false"></telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="false">
        <Scrolling AllowScroll="true" UseStaticHeaders="false" />
    </ClientSettings>
</telerik:RadGrid>


Attachments:
(1) I have attached a screen capture of the grid as it displays with default settings as grid_height_issue_1.png .

(2) I have attached a screen capture of the IE Developer Tools window where I have disabled the default height setting as grid_height_issue_2.png .

(3) I have attached a screen capture of the grid as it displays after disabling the default height setting as grid_height_issue_3.png.

Your help in the best manner of turning off this 300px height setting would be most appreciated.

Thanks!

Lynn

2 Answers, 1 is accepted

Sort by
0
Iancu
Top achievements
Rank 1
answered on 18 Jun 2011, 09:04 AM
I also have this problem!
Any help would be appreciated!

Iancu

LE:

Also when setting the RadGrid's height to 100%, you can see that the underlying div which is rendered gets a default height of 10px. 
Where do these sizes come from?
0
Accepted
Iana Tsolova
Telerik team
answered on 22 Jun 2011, 04:24 PM
Hi Iancu,

Check the below online resources elaborating on the case and try the solutions provided there:
http://www.telerik.com/help/aspnet-ajax/grid-height-vs-scrollheight.html
http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx

Greetings,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Lynn
Top achievements
Rank 2
Answers by
Iancu
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or