Question

I have an UltraGrid that is bound to some data from my database.
Occasionally the data set that the grid is bound to is empty.
When this happens, the headers appear as normal at the top of the grid, with no rows displayed.
When the user wants to transpose the grid, so they see the rows as columns, they click a button that we bind to this bit of code.

grid.Rows.Band.CardView = true;  

This works great in all cases but when the data set is empty.
When there is no data in the data set, the headers disappear.

How can I force the headers to stay there with an empty data set?

So far I have tried playing with the grid or band's properties to try and force them to stay visible, with no luck.
I also found that I can add an empty row to the grid, as a workaround. This is undesirable, however, because despite my best efforts I have been unable to hide the row from the user. And if you set the row's Hidden property to true, the grid's headers disappear.

This is the only similar issue I have been able to find, but sadly it also did not work.

Was it helpful?

Solution

To display the headers when there are no cards is a feature request and you should contact Infragistics to have a feature request created for you. Mike Saltzman provided more details on this in the following forum thread: http://www.infragistics.com/community/forums/p/59862/330102.aspx#330102

OTHER TIPS

As far as I know, when empty data set is bound to a grid, there is no way for grid to know, what type of objects (hence what columns) to display. If your empty collection would provide this information, I guess it would work.

One way to do this (as I have used) is implement a custom collection, which through ITypedList interface exposes properties (as PropertyDescriptor) of bound items as a template for a grid. Something similar to this or this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top