data binding nonconventionaly

  • Thread starter Thread starter Mike Gaab
  • Start date Start date
M

Mike Gaab

Is there any way to bind a control, say a label, that is not
directly associated with the data source? I was reading
an article a few days ago that showed how to bind
a asp:literal and some string format function to bind data to
the literal. The literal was then added to the ?? control container.
Unfortunately that is all I remember. I can't find it.
Anyway it sounded like a good idea but at the time I was
busy and did save it.

Hope that will jog someone's memory.
Thanks Mike
 
It's certainly possible to create the control
dynamically, set it's properties, and then add
it to it's container, whatever the container is.
For instance I have pages where I create a
table dynamically, create controls and set their
properties, add them to table cells, add the
table cells to table rows, and then the rows to
the table container.They go in the container
Controls collection using the Add() method:

<container obj>.Controls.Add(<control to be added>);
 
Raymond said:
It's certainly possible to create the control
dynamically, set it's properties, and then add
it to it's container, whatever the container is.
For instance I have pages where I create a
table dynamically, create controls and set their
properties, add them to table cells, add the
table cells to table rows, and then the rows to
the table container.They go in the container
Controls collection using the Add() method:

<container obj>.Controls.Add(<control to be added>);

I was thinking of adding a control
say to a datagrid container that was a label. The label being
bound to a value from the datagrid's datasource and the label's
physical position would be outside of the datagrid. Does
that make sense?

Thanks,Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top