>For the editor for your Dates, add a UIHint:
>
[UIHint("MyDateTimeTemplate")]
>
>Then create an editor template for it with the same name. For example:
>
@model DateTime?
>
>@Html.TextBox("", (Model.HasValue ? Model.Value.ToShortDateString() : string.Empty))
>< script type="text/javascript">
> $("#@ViewData.ModelMetadata.PropertyName").datepicker({ dateFormat: 'mm/dd/yy' });
>< /script>
>
>As for defining a new class for the dropdown, I believe that is unnecessary. Providing the display field name and value field name should be enough to only include those in the resulting html.
I understand it's enough in the resuling html, but if I have a Client reference in my class, it will grab all columns from the client. Since I only need two columns to be used in UI, what are my choices?
If it's not broken, fix it until it is.
My Blog