tags:

views:

33

answers:

1

Is there a way to hide all the DataGrid columns, and not make them included in layout, and still show the header row along with its header text?

I was able to make the DataGrid columns not visible, and not included in layout, but that makes the header text no longer appear.

If no data comes back from the data provider, I want all the columns to disappear and then the header row still be visible along with its text.

Any helps is appreciated. If I cannot figure it out, I guess I will just not show the entire grid at all, but I really want the header row with its text to still be visible.

FYI - In the place of the grid columns, I have a message alert appear, which is why I still want the header row with its text, but I need to not have the columns included in the layout, or visible so I can display the alert message.

Thanks

A: 

A DataGrid allows you to set the rowCount, which is the number of visible rows. Note that the header row is considered a row, so if you want to show just the header, set the rowCount to 1. Hope that helps.

Wade Mueller
I tried setting the rowcount to 1 but that didn't do what I want. The grid was still the same height (which is originally a rowcount of 10), but the actual rows were no longer visible. I need the rows to not be included in layout, except the header. I also, need to header text to still be visible.
Dana
You could also set the height of the DataGrid to be the height of the header row.
Wade Mueller