
Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
> I need the Eval for another property I am adding - OnClientClick. So the
> problem remains.
[quoted text clipped - 15 lines]
> > Microsoft ASP.NET Enthusiast
> > http://alvinzc.blogspot.com
Hi David,
Would you please tell me more about your custom ButtonField control? Such
as why you want to inherit from ButtonField, what's the purpose of this
field?
A ButtonField represents a field that is displayed as a button in a
data-bound control. It's not inheriting from Control or WebControl, and it
doesn't have the DataBinding event and the BindingContainer property which
are required for Data Binding expression to work on it.
IMHO, the ButtonField is only used where you need to render a field as
button or link, other than that purpose, it's recommended to use
TemplateField which you have full control.
Anyway, I think we might discuss it further after you described more about
the purpose of the customized ButtonField control. Thanks.
Sincerely,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
David Thielen - 26 Oct 2006 16:15 GMT
Hi;
I'm using it as an Image button and then addint the onmouseover, etc to have
3 bitmap images. I like inheriting from ButtonField because then adding that
item as a column in a GridView is a single <aspMy:MyButtonField...> node
rather then <asp:Template><ItemTemplate><asp:LinkButton> which makes it more
complex.
I can do this either way. I think my real questions are:
1) What are the tradeoffs of using a DataControlField vs a Template node for
each column in a GridView? I know they both work but they seem to be designed
differently and that leaves the question of what each was meant for.
2) Why is there no databinding in a DataControlField? Again, that seems to
me to be a natural. So if I have my own derived DataControlField and need an
OnClientClick property - should I have a OnClientClickFormat and
OnClientClickData or just an OnClientClick plus databinding?
I know how to implement this either way. My question is what is the "right"
way to do so. I'm worried that I don't understand why there are these two
approaches to adding column controls and when each makes more sense.

Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
> Hi David,
>
[quoted text clipped - 39 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
Walter Wang [MSFT] - 27 Oct 2006 04:26 GMT
Hi David,
You can find more detailed information on the difference between
DataControlField and TemplateField, also with a custom data control field
example on how to get the bound data:
#Custom Data Control Fields
http://msdn.microsoft.com/msdnmag/issues/06/01/CuttingEdge/
I think your requirement can be done using a customized DataControlField.
Please have a look at the above example and see if it helps.
Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.