1

I have some collections of objects that inherits DynamicObject class, all works great with the BindingSource and BindingNavigator, but I don't have the dynamic properties displayed on the DatagridView.

The objects inherits DynamicObject and overrides the TrySetMember, TryGetMethod and GetDynamicMemberNames, I think that it is sufficient.

It also implements the INotifyPropertyChanged interface for the binding updates.

I'm forgetting something? or is it possible to do?

what I have now is:

protected BindingList<Users> _Users;
_Users = _Ctl.GetAll();

BndSrc.DataSource = _Users;

BndNav.BindingSource = BndSrc;

Grid.DataSource = BndSrc;

Note: the _Ctl is a object that gives me all the users, the Users class inherits DynamicObject and have properties defined dynamically, like Username, Password and Name, it is all working well, but the datagrid don't display the dynamic properties.

7
  • Can you post an example? Commented Apr 2, 2011 at 18:12
  • I edited the question and included an example Commented Apr 2, 2011 at 18:27
  • Your post title and tags indicate this is a C# question - but your sample is in VB.NET? Commented Apr 2, 2011 at 18:33
  • Sorry my mistake, I work a lot with the 2 languages, but the question is valid for both. Commented Apr 2, 2011 at 18:36
  • I'm confused - this is WinForms DataGridView, not WPF DataGrid? If so, why do you say you implemented INotifyPropertyChanged? Commented Apr 2, 2011 at 19:29

1 Answer 1

1

Databinding to dynamic (DynamicObject) objects is broken and MS has resolved it as "Wont fix".

https://connect.microsoft.com/VisualStudio/feedback/details/522119/databinding-to-dynamic-objects-is-broken

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.