Object Binding Series - Just Added One More!

Object Binding Series - Just Added One More!

  • Comments 9

I just added a new video (#4) to the Object Binding Series on filtering your custom objects -- based on customer request -- so keep them coming! The code is also attached.

Enjoy!

Attachment: 4FilteringAndObjectBinding_Code.zip
Leave a Comment
  • Please add 2 and 6 and type the answer here:
  • Post
  • Beth,

    Thanks for the video!  It was exactly what I needed.

  • Thanks for the awesome video. Its perfect.

    Just a quick question: I followed you video and created my own database with no data. Update to the database and dataadapter works fine in the back end but my Datagridview row disaappears when I click outside the datagridview.

    Not sure what I'm missing. Is there a property I need to set beside AllowUserToRows = True

  • In the Sortable tutorial, when I close the form I an exception "Sort string contains a property that is not in the IBindingList".  I tried looking up the exception but received no hits.

  • Hi NZ,

    Make sure to call Me.Validate and Bindingsource.EndEdit before you call the update on the TableAdapter.

    -B

  • Hi Jr,

    You can work around this bug by resetting the Sorts in the FormClosing event:

       Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

           Me.StateBindingSource.Sort = ""

           Me.CitiesBindingSource.Sort = ""

       End Sub

    HTH,

    -B

  • These videos are great. Simple and understandable. And I didn't have to fly to Toronto or anything!

    Congratulations on your 1 year anniversary.

  • A possible improvement?

    I added this line to the end of RemoveSortCore():

    OnListChanged(New ListChangedEventArgs(ListChangedType.Reset, -1))

    I causes the DataGridView to show the new row asterisk as soon as you click the remove sort button. Lets the user that he can now add a new row.

  • Beth, I just stumbled across your video series and found the object binding presentations to be most excellent!  If you are looking for other ideas for videos on binding-related topics, I am struggling with a good method of having a bound DataGrid to update the view whenever the bound business object property changes.  Some type of "I'm dirty -- refresh me" without having the business object specifically request a Refresh to the UI.

    Again, thanks for your contribution to my education!

  • Hi Craig,

    You need to implement the INotifyPropertyChanged interface on your business objects and then use a BindingList(Of T) to hold then. This will play nice with the BindingSource and controls will be notified of any changes to the object properties outside of the control.

    HTH,

    -B

Page 1 of 1 (9 items)