Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

How to use the GridView extension in a Full Screen mode (100% browser Width and Height)

$
0
0

This example is based on recommendations from the E3940: How to use the ASPxPageControl control in a Full Screen mode (100% browser Width and Height) Code Central example.

It illustrates how to use this technique in an ASP.NET MVC application and resize a DevExpress ASP.NET MVC extension (for example, GridView) to occupy the entire browser window (a Full Screen mode):

/Views/Shared/_Layout.cshtml:

[CSS]
body,html{padding:0;margin:0;}

Main View:

[JScript]
<script type="text/javascript"> function OnInit(s, e){ AdjustSize(); ASPxClientUtils.AttachEventToElement(window, "resize", function(evt){ AdjustSize();});}function OnEndCallback(s, e){ AdjustSize();}function AdjustSize(){var height = document.documentElement.clientHeight; grid.SetHeight(height);}</script> @Html.Partial("TypedListDataBindingPartial", Model)

PartialView:

[C#]
@Html.DevExpress().GridView(settings=>{settings.Name="grid";settings.ClientSideEvents.Init="OnInit";settings.ClientSideEvents.EndCallback="OnEndCallback";...settings.Width=System.Web.UI.WebControls.Unit.Percentage(100);settings.Settings.ShowVerticalScrollBar=true;settings.SettingsPager.Mode=GridViewPagerMode.ShowAllRecords;}).Bind(Model).GetHtml()

See Also:
E1081: How to use the ASPxGridView control (with the enabled vertical scrollbar) in a Full Screen mode (100% browser Width and Height)
E3940: How to use the ASPxPageControl control in a Full Screen mode (100% browser Width and Height)

Question Comments

Added By: Daniel Gradwell 1 at: 6/19/2014 6:35:51 AM    

This code works fine on an MVC if you don't have a footer panel. However if you have a footer panel the gridview goes under the footer rather than just filling the content area,

Can you advise how to avoid this?

Thanks

Added By: Larry (DevExpress Support) at: 6/19/2014 12:57:08 PM    Hello,

I have created a separate ticket on your behalf to process your inquiry more effectively:

How to use the GridView extension in a Full Screen mode (100% browser Width and Height) when page has footer

Please refer to it for further correspondence.


Viewing all articles
Browse latest Browse all 7205

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>