Currently, I am developing a web application using asp.net mvc-4 and incorporating bootstrap 2.0 into the design. The main tool I am utilizing in almost every controller is the asp.net mvc web grid due to its efficient sorting, paging, and minimal code requirements. However, I have encountered an issue when users access the web grid on mobile devices. The columns become very thin, making it nearly impossible to read the data.
To address this problem, I have identified two possible solutions for enhancing the web grid interface on mobile devices:
The first approach involves using the Style: "hidden-phone" attribute on less important columns. This hides these columns on mobile devices, allowing the most crucial column to be prominently displayed:
var gridcolumns = new List<WebGridColumn>(); gridcolumns.Add(new WebGridColumn() { ColumnName = "OrderID", Header = "", Style = "hidden-phone", CanSort = false,
The second approach entails using CSS styles to change the table format from row to block. More information on this method can be found here.
Based on my experience, the first approach provides a user-friendly solution by displaying the webgrid as a table with essential columns visible. On the other hand, the second approach ensures all information is presented without any elements hidden. Nevertheless, displaying webgrid rows as blocks may limit users to viewing only two blocks at a time without scrolling.
In overall comparison, which approach do you think is better? Concealing some columns for a more streamlined user experience or presenting all information as blocks despite potential usability issues?