Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
Disable expansion of Mvc.GridModel ColumnLayout if child data rows would be blank
posted

I'm using the Mvc.GridModel and showing sales order line item information (including a batch number if it has one) in the main grid and then using a GridColumnLayoutModel added to the main grid's ColumnLayouts to show another grid of batch information related to the line item.  This works great when the line item has a batch number that is passed to the DataSourceUrl.  The + icons expand the sub-row, gets the data, and displays it.  However, some sales order line items won't have a batch number.  Clicking on the + icon expands the sub-row and tries to get the data which returns 0 rows and subsequently just shows the column headers.  It is a wasted effort for the end user to click on something that shows essentially nothing - not even a message explaining why no data was returned.

  1. Is there a way to disable or entirely remove the + icon for a particular row in the main grid if a field on that row is null/blank?
  2. Is there a way to detect that no rows have been returned from the DataSourceUrl and display a custom message instead of the column headers for the sub-grid? (e.g., "If there's no batch number, no batch information can be shown.")
Parents Reply Children