Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataBinding
Message
General information
Forum:
ASP.NET
Category:
Other
Title:
Miscellaneous
Thread ID:
00845808
Message ID:
00845841
Views:
15
>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...
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform