Here is the VB annotations. Tested and it works. Note: We will probably support the ReadOnly attribute in the next version. It's not currently supported.
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Web
Imports System.Web.DynamicData
Imports System.ComponentModel.DataAnnotations
Imports System.ComponentModel
Imports System.Text.RegularExpressions
<MetadataType(GetType(ProductMD))> _
Partial Public Class Product
End Class
Public Class ProductMD
Private _QuantityPerUnit As Object
<ScaffoldColumn(False)> _
Public Property QuantityPerUnit() As Object
Get
Return _QuantityPerUnit
End Get
Set(ByVal value As Object)
_QuantityPerUnit = value
End Set
End Property
Private _ProductName As Object
' [ReadOnly(true)]
<UIHint("Text_RO")> _
Public Property ProductName() As Object
Get
Return _ProductName
End Get
Set(ByVal value As Object)
_ProductName = value
End Set
End Property
End Class
ricka6
All-Star
15070 Points
2272 Posts
Microsoft
Moderator
Re: Show Field But Do Not Allow Editing
Jan 23, 2009 08:54 PM|LINK
Here is the VB annotations. Tested and it works. Note: We will probably support the ReadOnly attribute in the next version. It's not currently supported.
Imports System Imports System.Collections.Generic Imports System.Linq Imports System.Web Imports System.Web.DynamicData Imports System.ComponentModel.DataAnnotations Imports System.ComponentModel Imports System.Text.RegularExpressions <MetadataType(GetType(ProductMD))> _ Partial Public Class Product End Class Public Class ProductMD Private _QuantityPerUnit As Object <ScaffoldColumn(False)> _ Public Property QuantityPerUnit() As Object Get Return _QuantityPerUnit End Get Set(ByVal value As Object) _QuantityPerUnit = value End Set End Property Private _ProductName As Object ' [ReadOnly(true)] <UIHint("Text_RO")> _ Public Property ProductName() As Object Get Return _ProductName End Get Set(ByVal value As Object) _ProductName = value End Set End Property End Class