Language: VB.NET
DataLayoutControl BindingInfo
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:
Tags:
Description:
The DataLayoutControl BindingInfo provides numerous items of interest, for this example I am concerned with obtaining the default "Caption".
Report Abuse
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search

