CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Language: VB.NET

DataLayoutControl BindingInfo

288 Views
Copy Code Show/Hide Line Numbers
   1:  <Extension()> _
   2:  Public Function GetBindingInfo(ByVal DataLayoutControl As DataLayoutControl, _
   3:                                 Optional ByVal ExcludePropetries As String = "") As List(Of DataLayoutBindingInfo)
   4:      Dim bh As New LayoutElementsBindingInfoHelper(DataLayoutControl)
   5:      Dim info As LayoutElementsBindingInfo = bh.CreateDataLayoutElementsBindingInfo
   6:      GetBindingInfo = (From x As LayoutElementBindingInfo In info.GetAllBindings _
   7:                        Where (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludeNames)) _
   8:                        And (Not x.DataInfo.Name.ToUpper.EqualsAny(ExcludePropetries)) _
   9:                        Select New DataLayoutBindingInfo(x.DataInfo.Name, x.DataInfo.Caption, x.Visible, x.EditorType)).ToList
  10:  End Function
  11:   
  12:  Public Class DataLayoutBindingInfo
  13:      Private _Name As String
  14:      Private _Caption As String
  15:      Private _Visible As Boolean
  16:      Private _EditorType As Type
  17:      Public Sub New(ByVal name As String, ByVal caption As String, ByVal visible As Boolean, ByVal editorType As Type)
  18:          _Name = name
  19:          _Caption = caption
  20:          _Visible = visible
  21:          _EditorType = editorType
  22:      End Sub
  23:      Public ReadOnly Property Name() As String
  24:          Get
  25:              Return _Name
  26:          End Get
  27:      End Property
  28:      Public ReadOnly Property Caption() As String
  29:          Get
  30:              Return _Caption
  31:          End Get
  32:      End Property
  33:      Public ReadOnly Property Visible() As Boolean
  34:          Get
  35:              Return _Visible
  36:          End Get
  37:      End Property
  38:      Public ReadOnly Property EditorType() As Type
  39:          Get
  40:              Return _EditorType
  41:          End Get
  42:      End Property
  43:  End Class
  44:   
  45:   
by Thom Lamb
  May 19, 2010 @ 7:42am
Tags:
Description:
The DataLayoutControl BindingInfo provides numerous items of interest, for this example I am concerned with obtaining the default "Caption".

Add a comment


Report Abuse
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate