Back to Devexpress

ASPxGridViewPagerSettings.ShowEmptyDataRows Property

aspnet-devexpress-dot-web-dot-aspxgridviewpagersettings-5e8b0f21.md

latest3.4 KB
Original Source

ASPxGridViewPagerSettings.ShowEmptyDataRows Property

Gets or sets whether to show empty data rows if the number of data rows displayed within the last page fits entirely on the page.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(false)]
public bool ShowEmptyDataRows { get; set; }
vb
<DefaultValue(False)>
Public Property ShowEmptyDataRows As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true to show empty data rows; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to ShowEmptyDataRows
ASP.NET MVC ExtensionsGridViewSettings

.SettingsPager .ShowEmptyDataRows

| | MVCxGridViewProperties |

.SettingsPager .ShowEmptyDataRows

| | ASP.NET Web Forms Controls | ASPxGridView |

.SettingsPager .ShowEmptyDataRows

| | GridViewProperties |

.SettingsPager .ShowEmptyDataRows

|

Remarks

The number of rows displayed within a page is specified by the ASPxGridViewPagerSettings.PageSize property. By default, if the number of data rows displayed within the last page fits entirely on the page, the ASPxGridView is automatically resized to hide the empty space (see the image below, the ASPxGridViewPagerSettings.PageSize property is set to 8 ):

Set the ShowEmptyDataRows property to true to display empty rows. In this case, the grid is not resized.

Web Forms approach:

aspx
<dx:ASPxGridView ID="GridView" runat="server">
    <Columns>
    ...
    </Columns>
    <SettingsPager ShowEmptyDataRows=true PageSize="20" />
</dx:ASPxGridView>

MVC approach:

razor
@Html.DevExpress().GridView(settings => {
    settings.Name = "gridView";
    ...
    settings.SettingsPager.PageSize = 20;
    settings.ShowEmptyDataRows=true;
    ...
}).Bind(Model).GetHtml()

See Also

Grid View

ASPxGridViewPagerSettings Class

ASPxGridViewPagerSettings Members

DevExpress.Web Namespace