compactframework >> User Control and Binding

by VGltIFJhbWw » Mon, 18 Jul 2005 22:16:03 GMT

I've got a user control in v1.1 VS2003 and am curious if/how I can implement
binding. I'm *thinking* I'd like something like:

MyControl.Value=<bound to some object being updated elsewhere>

Is this possible?


compactframework >> RE: User Control and Binding

by QWxleCBZYWtobmluIFtNVlBd » Mon, 18 Jul 2005 22:36:24 GMT


What kind of data do you expect your control to display?
Is it a single value, a list or a table?

compactframework >> RE: User Control and Binding

by VGltIFJhbWw » Mon, 18 Jul 2005 23:00:22 GMT

At the moment, my Value property is declared as an Object so i can handle any
type. In reality, it's going to be either a string or a number so I've
considered just making the property a string. Because the control does
number based value comparisons, making it a string just means I need to
validate that Value is a number before I consider doing my comparisons (right
now, I just check if type is String else I assume its a number and do my
compares...probably not exactly right but good for the moment).

compactframework >> RE: User Control and Binding

by QWxleCBZYWtobmluIFtNVlBd » Mon, 18 Jul 2005 23:30:03 GMT

Generally, you'd need to have the object that you use to bind, to raise some
event whenever its value is been changed. Hookup into this event in your user
control and update the display value. You'd probably should have 2 properties
- similar to how data bainding is implemwented in .NET - DataSource and
DataMember.

Similar Threads

1. User Control Data binding - Asp.Net

2. User control lookup binding

Any one know how to derive a class from 'DataGridViewColumn' which supports 
'Lookup binding', just like 'DataGridViewComboBoxColumn'. There are several 
exaples on 'simple binding', but no one is on 'Lookup binding' or 'Complex 
binding'.

Also i tried by using attribute
[LookupBindingProperties("DataSource", "DisplayMember", "ValueMember", 
"LookupMember")]

but couldnt succeed.

One more thing, can any one recommend, how can we support them in user 
control, if usercontrol just has textboxes only.








3. User Control RandID binding to an XML ID Node

4. Inherited DataGridView user control with Binding Navigator

I created a class that inherits from the DataGridView.  It works just
the way I wanted it to.  I added a BindingNavigator to the designer
screen of this class.  The screen says, "To add components to your
class, drag them from the Toolbox and use the Properties window to set
their properties."

I don't get any errors, but the BindingNavigator does not display.
How do I get it do show up in the control when I use it on a form?

5. binding user control to Repeater web control

6. Losing state on bound controls in user controls

7. binding user control to repeater web control - Asp.Net

8. How to represent the data in a not bound control via bound control

Hello everybody,
I have in a VWD-Project a sqldatasource-control bound with
DetailsView. If I want to show the data in a label-control, how to retrieve 
them. Which property of  DetailsView contains the text from the database?
This is a beginner question, but I cannot find the solution for:

Label1.Text = DetailsView1.???

Thank you for any idea!

Mario