Description:
This article describes how to troubleshoot a situation when the grid bound to data in Server Mode displays no data. At the same time, data in the database is valid and columns in the grid are bound to existing data source item fields. The problem might occur immediately or after a user applies sorting or filtering.
Answer:
In Server Mode, the data loading operation usually consists of two actions. First, the Server Mode collection requests a database for a total number of records. When the number is obtained, it loads data from the database.
The state when the grid displays empty rows indicates that the total number of records is obtained but an attempt to load data failed. The failure usually followed by a CLR exception that is handled internally. So, the application does not fail due to this exception but the grid displays no data in cells. Under certain circumstances, data might be displayed partially.
Since this problem is always caused by an internal exception, it is not difficult to determine its cause if you can reproduce the problem in the development environment where you can debug your application with Visual Studio.
By default, Visual Studio debugger does not catch handled exceptions or exceptions thrown in third-party code. To debug such exceptions, it is necessary to enable catching user handled exceptions as described in the the How to: Break When an Exception is Thrown article and disable the Show Just My Code option in Visual Studio settings (see Managing Exceptions with the Debugger). Precise steps are described in our Knowledge Base article: How to obtain the exception's call stack.
When the debugger breaks with an exception, carefully read the exception message. Some exceptions are not relevant. Such exceptions as FileNotFoundException, UnauthorizedAccessException, SecurityException, HttpException, etc. are irrelevant to the problem discussed here. Feel free to skip these exceptions and continue debugging until you catch an exception that is of interest.
Once you find an exception that you feel is related to the problem, the work is almost finished. In most cases, the exception message clearly identifies the cause of the problem, and you just have to fix it.
If it is not possible to debug the problematic scenario in Visual Studio (for example, the problem is reproduced by an end user), it is still possible to obtain information about exceptions. For this purpose, you can use the AppDomain.FirstChanceException event to write all exceptions messages and stack traces into a log file.
If it is difficult to determine the cause of the exception based on the error message, feel free to report this issue to our Support team. Attach the exception stack trace and message to your inquiry and provide a brief description of the issue. When does it occur? What actions does an end-user perform before the issue occurs? Our engineers have wide experience in solving such issues and will do everything possible to help.
See Also:
T218612: ASPxGridView / MVC GridView Extension displays empty rows when bound via Server Mode
Thanks, this is very helpful. Is there any way to configure an ASP.NET application to catch and log or show these messages in an environment without VS? I've got an issue I can't reproduce locally, and I've seen how helpful the internally handled exceptions that the ASPXGridView throws are; I'd love to be able to send them to my exception handler or even display them to the user.
Hello Andy,
You can use the AppDomain.FirstChanceException event for this purpose, or corresponding events of the Server Mode component, as suggested in another Knowledge Base article: ASPxGridView / MVC GridView Extension displays empty rows when bound via Server Mode
Hello Uriah,
Can you please show a sample that we can use in web applications to catch the exception? The second link mentioned by you does not apply to XpoDataSource. I am unable to reproduce the error with my local VS but it displays empty records after publishing to server.
Hello Nitesh,
We detected that you posted duplicated comments to several tickets (T218612, T228863). We kindly ask you to avoid posting duplicated issues in the future. This will save time and allow us to process your inquiries in the most efficient manner.
Let's keep our conversation in a single ticket you have created regarding this subject:
T264246: ASPxGridView displays empty rows when bound via Server Mode
Your time and cooperation are greatly appreciated.
Hello Mike,
Apologies for this. I will keep this in mind.
Hello Mike, I am using Embarcadero Delphi environment. However, i have same problem in my huge data… Can you help about the solution? or for recovering the problem… I hope I can reach some of developers who can help me in that terrible situation…
Thanks.
Hello Matt,
To process your recent post more efficiently, I created a separate ticket on your behalf: T331907: What to do when the grid displays blank rows in Server Mode. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.
Hi,
The links in the article are outdated.
Thanks,
Marcelo.
Hello Marcelo,
Thank you, I updated the links.