Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Binding to a grid and not showing all the properties.
posted

Hi,

I have a custom object that inherits from BindingList<T>, it has several properties and I wish to bind it to the grid.

This is all good, but what if I don't want 5 out of the 10 properties to be bound and shown in the grid, how do I go about doing this?

I have setup the columns at design-time so the column headers are correct like, 'Security Code' instead of 'SecurityCode', (with a space), but when I bind to the grid it still adds the properties to the grid, even though I haven't specified them at design-time. Can this be overriden?

I don't want to have to hide each column after it's been bound, otherwise one would have to remember when a new property is added to this custom object, the code that binds the object to the grid must be updated to stop the new property from showing up on the gird.

Cheers,

Pete.