Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating Custom Data Bound Controls
Message
 
To
24/11/2009 15:56:39
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
01436389
Message ID:
01436503
Views:
27
I guess the question I need answered is what exactly happens when a control is bound? When you set DataMember and DataSource in a grid, how does each row in the table become a row in the grid?

When you bind to a list or combo, how does each row of data in the table become a list item?

Inquiring minds wanna know...




>>I have been researching this, and all the examples tell you basically how to drop a data control onto a user control and set the DataSource/DataMember controls via a property.
>
>That doesn't always end up being the best way to do this. You have to take examples with a big grain of salt, IMHO.
>
>>I want to create my own specialized list control, with my own DataSource and DataMember properties, and when set, have one instance of a row object mapped to a row in a data table.
>
>First, what kind of list are you talking about specifically? A ListView or a ListBox control? (Or a List< >? ... which isn't a control.)
>
>Secondly, I wouldn't databind to a DataRow ... you want to bind to the DataTable or to a BindingSource (which the developer could set to anything, which may be good or bad, depending on whether you do or do not want to limit what's allowed with your class). I wrote my Framework back in the 1.1 days, and BindingSource was not introduced until 2.0, consequently all of my controls databind to a DataTable.
>
>~~Bonnie
>
>
>
>
>>I have been researching this, and all the examples tell you basically how to drop a data control onto a user control and set the DataSource/DataMember controls via a property.
>>
>>I want to create my own specialized list control, with my own DataSource and DataMember properties, and when set, have one instance of a row object mapped to a row in a data table.
>>
>>My first thought was to loop through all the rows in the table and for each row add a row to the list.
>>
>>Is there a dynamic way to do this?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform