Data Binding In Depth

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Data Binding In Depth - Presentation Transcript

    1. Data Binding in Depth DEV 419 Level 400 Eyal Vardi CEO Experts4D Microsoft VSTO MVP blog: www.eVardi.com
    2. Agenda
      • Data Binding Overview
      • BindingSource Class
      • Data Source & Interfaces
      • Binding Class Improvement
    3. Application Architecture Binding
    4. What Can we Bind? One Way Two Way .NET Controls Simple Binding .NET Controls Complex Binding Data Consumers Data Providers Object ArrayList DataSet Custom Collection Config File You can only bind to the public properties
    5. Simple Binding Label, TextBox, PictureBox, DateTimePicker Complex Binding DataGrid, ComboBox, ListBox
    6. Data Binding Goals
      • Run-Time:
        • Binding Data to Controls
        • Synchronize the data between the controls
        • Formatting and Parsing the data
        • Filter , Sort and Search the data
      • Design-Time:
        • Simple and fast to implement
    7.  
    8. Data Templates Data Template class Address { string Address {get;set} string City {get;set} string COuntry {get;set} string PostalCode {get;set} } User Control
    9. Customize Data Source Win
      • Need to implement one of the following data binding attributes:
        • Default BindingPropertyAttribute
        • Complex BindingPropertiesAttribute
        • Lookup BindingPropertiesAttribute
    10. Data Template
    11. Binding Source
    12. The Binding Flow * Don’t forget to add default constructor BindingSource DataSet DataTable DataSource DataMember Simple Control Complex Control Column DataBinding Property DataSource BindingSource
    13. Closer look on BindingSource Control BindingSource Simple Binding Complex Binding CurrencyManager Control Data Source Binding Binding BindingContex
    14. BindingSource Class (Binding Contex)
    15. BindingSource.DataSource =
      • Array => No Add & Remove
      • List<> => Add & Remove
      • TypOf => Add & Remove
      • new Object() => Add & Remove
      • * BindingList<> => Add & Remove
      • DataView => Add, Remove, Sort, Search, Filter
      • * Dervied Class can Support:
        • Sort, Search and Filter
      ?
    16. BindingSource Class (Sort, Find & Filter)
    17. Data Source & Interfaces
    18. IEnumerable ICollection IList IBindingList .NET 1.x Interfaces
    19. .NET 2.0 New Interface
    20. Build Custom Data Source
      • Interfaces should be implemented in your custom collection
        • IBindingListView
          • Sort
          • Advanced Sort
          • Filter
          • Search
    21. Recipe…
      • Inherit BindingList<>
      • Add sort and search capability
      • Implement IBindingListView for getting advance sort and filter capability
    22. .NET 1.x Interfaces
    23. BindingListView<T>
    24. Build Custom Data Source
      • Interfaces should be implemented in your custom type
        • INotifyPropertyChanged
        • IEditableObject
        • IDataErrorInfo
        • INotifyPropertyChanged
        • IEditableObject
        • IDataErrorInfo
    25. New Feature in Binding Class
      • Update mode
      • Formatting data
      • Null Value
      • Error notification
    26. New Feature in Binding Class
    27. Custom Formatting & Parsing
      • We use the Binding class events:
        • Format , raised when data is pushed from the data source into the control
        • Parse , raised when data is pushed from the control into the data source
      Control Data Source Parse Event Format Event Binding
    28. Type Conversion
        • Custom data type to string, can be done:
          • Override the ToString()
          • Use the Binding Format event
          • Write custom class for conversion
        • String to custom data type, can be done:
          • Use the Binding Parse event
          • Write custom class for conversion
    29. Custom Formatting & Type Converter
    30. DataSet Can’t Solve All your Problems
    31. Books www. izzy books.com
    32.  
    33. New York! New York!
      • איך ממלאים משוב ?
      • ב - email בסוף כל יום
      • ב - Beat Center
      • מה מקבלים ?
      • חולצת Feel The Beat
      • השתתפות בהגרלת כרטיסי טיסה
      • מכשירי i-mate ועוד ... ( לממלאים משוב לכל יום )
      DEV419
    34. Your potential. Our passion. TM

    + Eyal VardiEyal Vardi, 2 years ago

    custom

    1338 views, 0 favs, 0 embeds more stats

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1338
      • 1338 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 6
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories