Skip to main content
All docs
V23.2

Grid displays empty rows in database server mode

When ASPxGridView is bound in database server mode it may display a set of empty rows and a correct pager.

This behavior occurs when an underlying data source executes several queries to get data. While the pager request may pass, the data query can fail because the column used a key expression that contains non-unique values. As a result, the pager and related number of records are displayed correctly, but there is no data in these cells.

To resolve this issue, you need to get information about the exception. Handle the following events to obtain internal exception details (if any):

  • The ServerExceptionThrown event for XPServerCollectionSource.

  • The ExceptionThrown and InconsistencyDetected events for LinqServerModeDataSource or EntityServerModeDataSource.

    <dx:LinqServerModeDataSource runat="server" ID="LinqServerModeDataSourceIDHere"  
        OnExceptionThrown="LinqServerModeDataSourceIDHere_ExceptionThrown"  
        OnInconsistencyDetected="LinqServerModeDataSourceIDHere_InconsistencyDetected" />
    
    protected void LinqServerModeDataSourceIDHere_ExceptionThrown(object sender, DevExpress.Data.ServerModeExceptionThrownEventArgs e) {  
        var ex = e.Exception;  
    }
    protected void LinqServerModeDataSourceIDHere_InconsistencyDetected(object sender, DevExpress.Data.ServerModeInconsistencyDetectedEventArgs e) { 
        var ex = e.Message;  
    }
    

You can use recommendations from the following article to see all exceptions and obtain details required for diagnostic: Obtain an Exception's Call Stack in Visual Studio