Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 6th, 2008, 07:48 AM
Authorized User
 
Join Date: Apr 2008
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AspNetGuy
Default Events for Control Inside DetailsView

Ok, maybe it's my lack of understanding, but ...

In VWD, when I highlight a TextBox control contained by a <ContentTemplate> but not contained by another container or control VWD shows me the events available to the TextBox, such as TextChanged. I can double click on the event and voila a method is created in the codebehind file.

When I move the TextBox inside a DetailsView control, I no longer have access to the events for the TextBox. I assume this has to do with the architecture of the DetailsView.

How do I get access to a control's events when the control is inside a DetailsView?

If you want to point me to a tutorial that explains this cool. I haven't been able to find anything.

Thanks in advance for any help given.

  #2 (permalink)  
Old June 6th, 2008, 09:24 AM
Authorized User
 
Join Date: Apr 2008
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AspNetGuy
Default

Just to clarify a point.

I see that I can code the event directly on the control when in Source View, but my question is: Even when I select the TextBox control in Source View when the control is contained within a DetailsView control, the "lightning bolt" does not show in the Properties Window. Is this normal behavior, or do I have something configured incorrectly?

Thanks.

  #3 (permalink)  
Old June 6th, 2008, 12:22 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

You need to change the Field with the TextBox to a TemplateField. Then you can edit that template, select the TextBox and then the Events are available.

Steps:

1. Open the Smart Tasks panel for the DetailsView control and choose Edit Fields.

2. Select the Field with the TextBox and choose Convert this field into a TemplateField and click OK

3. Open the Smart Tasks panel for the DetailsView control again and choose Edit Templates

4. From the DropDown on the Smart Tasks panel choose Edit Item Template

5. Now select the TextBox control.

Hope this helps,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
  #4 (permalink)  
Old June 6th, 2008, 02:09 PM
Authorized User
 
Join Date: Apr 2008
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AspNetGuy
Default

Imar,

Thanks for the suggestion. However, the fields were already templated. As I mentioned in the first post, it was a lack of understanding. Your post showing how to get at the events by Editing the templates works great.

Thanks.

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DetailsView Control on ManageCategories.aspx pinch BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 October 6th, 2007 09:15 PM
DetailsView Control Showkkath ASP.NET 1.x and 2.0 Application Design 2 August 21st, 2006 07:49 AM
Problem with updating the detailsview control rakesh225 ASP.NET 2.0 Professional 1 August 2nd, 2006 10:45 AM
Capturing toolbar events inside a dialog class pazzuzu Visual C++ 0 October 13th, 2004 01:35 AM



All times are GMT -4. The time now is 11:41 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.