derive own controls from BoundField?

  • Thread starter Martin Bischoff
  • Start date
M

Martin Bischoff

[this is question about the ASP.NET 2.0 details view control]

When I add a row which is bound to a string field, the details view displays
a single-line text box control in edit mode. Often, I would like to have a
text area instead. I know that I can achieve this by converting the row to a
template row and add a textbox with TextMode="MultiLine". But it seems to me
that this is a very common need, and I don't like to edit every page/row
where I need the same functionlity.

Is it possible to derive my own controls (e.g. containing a text area) from
BoundField and use them in a details view? Are there any samples
demonstrating this?

Thanks for any help,
Martin
 
S

Steven Cheng[MSFT]

Hi Martin,

Welcome to ASPNET newsgroup.
Regarding on the question on creating a custom Field for DetailsView, it's
possible and in fact this is already available for asp.net 1.x DataGrid
control. For DataGrid, we can create our custom datagridcolumn through
create custom class derived from DataGridColumn and override the certain
methods. And for the GridView/DetailsView contorl in asp.net 2.0, all the
XXXFields are derived from the DataControlField:

#DataControlField
http://msdn2.microsoft.com/library/3stahdsh(en-us,vs.80).aspx

Also, here is a tech article in MSDN discussing on creating a custom
datagrid Column, you can get some ideas from it:

#Creating Custom Columns for the ASP.NET Datagrid
http://msdn.microsoft.com/library/en-us/dnaspp/html/creatingcustomcolumns.as
p?frame=true

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)








--------------------
| Thread-Topic: derive own controls from BoundField?
| thread-index: AcWzeVkCdyqS/2oYS2WeWsBdmBXkCQ==
| X-WBNR-Posting-Host: 194.209.202.1
| From: =?Utf-8?B?TWFydGluIEJpc2Nob2Zm?= <[email protected]>
| Subject: derive own controls from BoundField?
| Date: Tue, 6 Sep 2005 23:57:01 -0700
| Lines: 15
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework.aspnet.datagridcontrol
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.datagridcontrol:5475
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.datagridcontrol
|
| [this is question about the ASP.NET 2.0 details view control]
|
| When I add a row which is bound to a string field, the details view
displays
| a single-line text box control in edit mode. Often, I would like to have
a
| text area instead. I know that I can achieve this by converting the row
to a
| template row and add a textbox with TextMode="MultiLine". But it seems to
me
| that this is a very common need, and I don't like to edit every page/row
| where I need the same functionlity.
|
| Is it possible to derive my own controls (e.g. containing a text area)
from
| BoundField and use them in a details view? Are there any samples
| demonstrating this?
|
| Thanks for any help,
| Martin
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top