how can I create a properties collection for a user control
How can I create a properties collection for a user control? (or reference
what's there if it already exist)
I have a user control that displays an HTML table with several values. For
each field's value I have a public property that is set from a repeater's
itemdatabound event. In the ItemDataBound Sub, I use something like the
following where the datasource column name is always the same as the form's
DisplayTable.FIELD1 = DataBinder.Eval(e.Item.DataItem, "FIELD1")
I have to go through and set approx. 30 fields just like this but I'd like
to do something that is completely independent of the number of columns
returned plus I'd rather not have to name each property or field should one
be deleted or added.... Something like:
dim x as property
for each x in MyUserControlInstance.PropertiesCollection
MyUserControlInstance..x= DataBinder.Eval(e.Item.DataItem, x)
I've tried several different approaches but can't get it working . The
compiler identifies the .x part after the control name as the source of the
error. I can't recall right this second if the message was 'identifier
expected' or 'expression expected' but I think it was one of these.
|All times are GMT. The time now is 12:15 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.