"Hide" a property from the CslaDataSource?

"Hide" a property from the CslaDataSource?

Old forum URL: forums.lhotka.net/forums/t/8560.aspx


cmay posted on Sunday, February 21, 2010

I have a few properties on my business objects that I never ever want to display on a webform.

Obviously it isn't a big deal to remove these properties from anything that I databind against, but I'm wondering if there is an attribute or something that I can apply to the property so it is ignored by the datasource?

RockfordLhotka replied on Sunday, February 21, 2010

In Windows Forms and WPF you can use the Browsable attribute from System.ComponentModel to "hide" properties from data binding. I don't know if Web Forms honors that attribute or not, but that'd be the attribute you'd want.

cmay replied on Monday, February 22, 2010

That same attribute seems to work with the CslaDataSource in asp.net too thanks.

I also double checked that databinding was still possible on that property, and it was, so this just prevents the grid from having these extra columns by default, when you first setup databinding, which is exactly what I wanted.  Thanks.

Copyright (c) Marimer LLC