>I mean, I have bound inside of template controls
>
><ItemTemplate>
> <cc1:MyLabel Text='<%# DataBinder.Eval(Container.DataItem, "mycolumn") '></cc1:MyLabel>
></ItemTemplate>
>
>
>But, I don't really want to put the column name inside of the aspx, I want to get ahold of the control at run-time and bind it that way. I haven't been able to get the instance of the control for binding, I think the event hooks might work, but what events would i need to look into.
I haven't tried this myself mind you, but there's ItemDataBound event that you can use for this. You have to monitor the items coming through there and then you can bind from there *I THINK*.
You can also do something liek this:
<& this.ItemTobind("SomeField") %>
in that method you can do whatever you need.
However, I'm not sure how you expect to do this if you don't somehow know inside of the ASPX WHAT you are binding against. You have to have some identifier to know what to bind against.
I recommend Dino Espositos Programmaing ASP.Net which talks a great deal about databinding and I picked up a bunch of little things I didn't know there. It's probably been the first time after I looked at his book that I started messing more deeply with DataGrid databinding to do some fairly tricky laytous and custom bindings...