Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > Making a property bindable?
 

Making a property bindable?

I have created a UserControl that has a public property of an internal type. I would like the control host to be able to bind a value to that property but the property is grayed out in the control host. I tried making the property simply an object type, but that did not solve anything.
EHCarleton  Monday, August 31, 2009 9:01 PM
I assume that by "bind a value" you actually mean assign a value to the property at design-time? Because data binding should work fine, even if the property is grayed out in the properties window. The reason why you see the property grayed out is that you haven't assigned any editor to the property and its type is not editable by the default editor. (Any custom type or the object type.)
  • Marked As Answer byEHCarleton Monday, August 31, 2009 10:22 PM
  •  
Michal Burger  Monday, August 31, 2009 9:43 PM
I assume that by "bind a value" you actually mean assign a value to the property at design-time? Because data binding should work fine, even if the property is grayed out in the properties window. The reason why you see the property grayed out is that you haven't assigned any editor to the property and its type is not editable by the default editor. (Any custom type or the object type.)
  • Marked As Answer byEHCarleton Monday, August 31, 2009 10:22 PM
  •  
Michal Burger  Monday, August 31, 2009 9:43 PM
Michal,

That makes sense why it is grayed out. Thank you.

Sam

EHCarleton  Monday, August 31, 2009 10:22 PM
If you need any more help feel free to ask ;).
Michal Burger  Monday, August 31, 2009 10:42 PM

You can use google to search for other answers

Custom Search

More Threads

• Help needed dinding a datagrid to properies of a business entity (including relations)
• Accessing TableAdapter from different class
• Referencing tablecell text in an embedded datagrid within a datagrid
• How to turn off Copy always option in vs2005
• DataGridView and fields
• How to Detect Changes in a DataTable?
• seting up a DataTable and inporting CSV file data
• retrieving data from the dabase and updating it
• Adapter Update does not work when DataGridView columns are not visible
• Search with ListView