Should you show a grid if it's empty?
We're in the process of developing a new desktop application for a customer which currently uses about 20 or so grids on various forms throughout the application.
I don't think the context of our application is that relevant, but just to give the full picture the customer sells vehicles and the content of the grid tends to be things like 'Vehicle Inspections' or 'Repairs on this Vehicle'.
The developers are pretty much split between showing an empty grid if there's no data or alternatively hiding the grid and putting some text saying 'No inspections for this 开发者_如何学编程vehicle', etc.
What is the best practice? Empty grid or text?
Better to show the grid headers and under that place a label indicating "No records".
I would show text or preferably do both
If you are using C# ASP.NET, the Gridview has an EmptyDataText Property that shows an item that looks like a Grid but it displays your message
The only bad thing about showing an empty Grid is that some people who look at the data may not understand that the page has completely loaded and that there are no results. Therefore, it is better to be safe and give them a message.
I'd go for the empty grid, but it is a tough call. The reason it is a tough decision is because neither option has any strong arguments, which means that argumenting over them isn't that important.
In our vehicle application we hide the grid and show a message if there is no data to display.
That said, my only advice would be - be consistant. Pick a method and stick to it across your application.
Your users will appreciate this considerably which ever route you take.
Definitely don't show an empty grid. It is best to always show a message.
I think it is likely best to have the grid visibly 'grayed out' with the mentioned text overlaid over it (readable, of course).
This will give the user an idea of what they would see if there WAS any data without giving them the thought that the query is still running or that the data isn't showing up for some reason.
Show the grid so the UI maintains a consistent feel, however make sure the grid has a message specifically stating that the search is complete and no records are on file.
This keeps things familiar for the user while still giving them a cue that the form is not still processing.
It depends on the circumstances. Most of the time it is best to show some kind of message indicating that there is no data.
If you see value in the user knowing what the interface would have been, then a good alternative is to show the grid with headers only and to display a message under it explaining that there is no data.
精彩评论