Groups | Blog | Home
all groups > asp.net building controls > april 2007 >

asp.net building controls : GridView Extending


Chuck P
4/18/2007 4:52:00 PM
Is their a way to extend or mess with the GridView control.
My goal is to add a column that has editing button (delete update, save,
cancel).

I did this with a template column and a little helper class. The class has
method that adds the column with all the controls, but, it happens at runtime.

What I would really like to just have is a property on the control that says
AddEditingFunctionality. If true at design time the column would get added
and the user could do stuff the template column like changing
CausesValidation and stuff on the buttons in the template column.

stcheng NO[at]SPAM online.microsoft.com
4/19/2007 12:00:00 AM
Hi Chuck,

Regarding on this GridView extending issue, I have also replied your
another thread "GridView ITemplate Columns", are they concerning the same
issue?

For your scenario, if you want to add a customized column(field) in
GridView which will have flexible setting to let user define in design-time
(aspx tempalte or through code), I think you can consider creating a custom
DataControlField class completely. Thus, you can use it as built-in
Gridview colums(such as BoundField) and add some properties in aspx markup
to control the runtime behavior. e.g.

<Columns>
<cc1:MyColumn property1="xxx" property2="xxxx" />
.....
</Columns>

here are some former threads that have discussed on creating custom
column/field for Gridview:

http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.data
gridcontrol/browse_thread/thread/85afe393d428cf73/299bbf4c24815e8b?

http://groups.google.com/group/microsoft.public.dotnet.framework.aspnet.webc
ontrols/browse_thread/thread/652359e1358ecf6c/834ed1c6afdaa69b

and an additional MSDN article about customizing GridView:

http://msdn.microsoft.com/msdnmag/issues/06/05/CuttingEdge/

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



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.
Chuck P
4/23/2007 6:36:01 AM
thanks,
I'll try making the custom column type.
stcheng NO[at]SPAM online.microsoft.com
4/23/2007 1:17:59 PM
Hi Chuck,

How are you doing? Have you got any progress on this issue? If you have any
further questions or anything else we can help, please feel free to post
here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
stcheng NO[at]SPAM online.microsoft.com
4/24/2007 12:00:00 AM
Thanks for your reply Chuck,

If you need any further help on this, please don't hesitate to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button