The DataGrid will always show just 5 rows because it does not prefetch the data during design time to display. The design time control is just a placeholder. At runtime the grid will expand to the size of the contained data. That is why you can't show just the header. VS .NET doesn't know your datatable is empty.
As far as the formating is concerned, you need to enter the format in the expression field using the following syntax:
{0:format string}
for example:
{0:d}
this displays the date portion of a datetime data type.
Here is a link to the online help that explains the syntax:
ms-help://MS.VSCC/MS.MSDNVS/cpref/html/frlrfSystemWebUIWebControlsBoundColumnClassDataFormatStringTopic.htm
Here is a link that shows you all the date format options you can use:
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpcondatetimeformatstrings.htm
>Hi All,
>
>I have a few issues I can't seem to find the solution in help for...
>
>1. The data grid dropped on the form has 5 rows displayed, which you can't seem to change. When I bind this to a data set that has no rows, the header takes on the full size of the grid design time height. Is there a way I can have it just show the header at the design time height?
>
>2. In the property builder of the form, there is a data format expression. Where can I find in the doc what to put in there. I seem to have found a few topics on format expressions, but whatever I put in the format expression field seems to be what is displayed in the grid. For example, I used m/d/yyyy for a date and m/d/yyyy, literally, was displayed.
>
>Thanks,
>BOb
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi