I'm not sure I understand. If I create a regular aspx
page. Create a DataAdapter and generate a dataset and
then put a datalist on the page. I can set the datasource
and datamember properties of the datalist. Then I can put
a button in the datalist, go to it's databinding
properties and bind any of the button's bindable
properties to a column from the dataset. It generates
something like the following in html
Databinder.Eval(Container, "DataItem.color") ...
I'm not sure what you meant by "ASP.NET controls dont have
this kind of binding" maybe I'm misunderstanding you.
thanks
John
-----Original Message-----
John,
I don't think that ASP.NET controls have this kind of
binding in them.Windows forms would allow you to specify a data source,
as well as aproperty of that data source, and specify the property
you want set as aresult.
I think you will have to set the control color
manually, depending onthe color name, as I don't think that web controls
support this level ofdata binding.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"John" <an*******@discussions.microsoft.com> wrote in
messagenews:0e****************************@phx.gbl... Hi,
heres a brief description of what I'm trying to do.
I have a sql table named colors that looks like this:
color_id color_name
1 blue
2 red
3......... and so on
I created a composite custom control overode the
CreateChildControls method where I created a Datalist
that has one child control (a button). I want to bind the
color from my sql table to the button's foreground color
When I include this control into a aspx page i want to
see 3 buttons (or as many buttons as I have colors in my
table). I'm having trouble with how to properly
databind to programatically databind to this datalist
programatically
thanks for the help
-J
.