Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WebGrid Questions...
Message
General information
Forum:
ASP.NET
Category:
WebForms
Miscellaneous
Thread ID:
00722328
Message ID:
00722455
Views:
11
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.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform