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

Radgrid Height Issue

1 Answer 46 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 10 Nov 2011, 12:14 PM
Hi,

I'm using a Radgrid in my web project, I'm having issues getting the Radgrid's height to size according to the content.
Basically I wish to have the radgrid take up full height and width of the page.
I need to use vertical and horizontal bars should it overflow and using static headers, as well as the columns to be inline with the header.

My page is within a masterpage and radgrid within an ajaxpanel, I have tried the radgrid within a table setting parent to 100% height & width 100%, as well as the ajaxpanel.

But still no luck at getting the desired outcome.
Any assistance would be greatly appreciated.

Thanks in advance.

(Below code I'm using)


      <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" HorizontalAlign="NotSet" LoadingPanelID="RadAjaxLoadingPanel1" Height="100%">
              
       <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
        <script type="text/jscript">
            function myRefreshGrid() {
                var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                masterTable.rebind();
            }


            function OnClientPageLoad(sender, args) {
                setTimeout(function() {
                    sender.set_status("");
                }, 0);
            }


            function RowDblClick(sender, eventArgs) {
                sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }


           
        </script>    
       </telerik:RadScriptBlock>

        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="odsSiteDetails" GridLines="None" ShowFooter="True" AllowFilteringByColumn="True" AutoGenerateColumns="False" Height="100%" Width="100%">
            <AlternatingItemStyle Wrap="False" /><ItemStyle Wrap="False" />
            <MasterTableView DataKeyNames="ID" DataSourceID="odsSiteDetails" TableLayout="auto" Width="100%">
                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                <RowIndicatorColumn Visible="False"><HeaderStyle Width="40px" /></RowIndicatorColumn>
                <ExpandCollapseColumn><HeaderStyle Width="40px" /></ExpandCollapseColumn>
                <Columns>
                 <telerik:GridButtonColumn CommandName="Select" Text="Edit" UniqueName="cmdSelect"></telerik:GridButtonColumn>
                 <telerik:GridButtonColumn ButtonType="ImageButton" UniqueName="Charts" HeaderText="" CommandName="Charts" ImageUrl="~/Images/chart.png"></telerik:GridButtonColumn>
                 <telerik:GridBoundColumn ShowFilterIcon="True" autopostbackonfilter="True" currentfilterfunction="Contains" datafield="ID" datatype="System.Int32" filtercontrolalttext="Filter ID column" headertext="ID" readonly="True" sortexpression="ID" uniquename="ID" visible="False"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn ShowFilterIcon="True" autopostbackonfilter="True" currentfilterfunction="Contains" datafield="Description" filtercontrolalttext="Filter Site column" headertext="Site" sortexpression="Site" uniquename="Site"></telerik:GridBoundColumn>
                 <telerik:GridBoundColumn ShowFilterIcon="True" autopostbackonfilter="True" currentfilterfunction="Contains" datafield="Address" filtercontrolalttext="Filter Address column" headertext="Address" sortexpression="Address" uniquename="Address"></telerik:GridBoundColumn>
                 </Columns>
                <EditFormSettings><EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn></EditFormSettings>
            </MasterTableView>
            <GroupingSettings CaseSensitive="False" />
            <ClientSettings>
         <Scrolling AllowScroll="true" UseStaticHeaders="true"></Scrolling>
           </ClientSettings>
            <EditItemStyle Wrap="False" />
            <ActiveItemStyle Wrap="False" />
        </telerik:RadGrid>
       
        
</telerik:RadAjaxPanel>
      <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" Skin="Default">
          
                </telerik:RadAjaxLoadingPanel>
                
    
    <div>
        <telerik:RadWindowManager ID="RadWindowManager1" OnClientPageLoad="OnClientPageLoad" runat="server"></telerik:RadWindowManager>
    </div>
                     
        <asp:ObjectDataSource ID="odsSiteDetails" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="SelectSiteDetails" TypeName="site">
            <SelectParameters>
                <asp:Parameter DefaultValue="-1" Name="ID" Type="Decimal" />
            </SelectParameters>
        </asp:ObjectDataSource>
     
</asp:Content>

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 10 Nov 2011, 05:13 PM
Hello Derek,

Please examine the second project in the code library below:
http://www.telerik.com/community/code-library/aspnet-ajax/ajax/how-to-set-100-height-and-random-styles-to-a-radajaxmanager-update-panel.aspx

Best wishes,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Derek
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or