Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 8th, 2013, 05:05 AM
Authorized User
Points: 303, Level: 6
Points: 303, Level: 6 Points: 303, Level: 6 Points: 303, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: , , United Kingdom.
Posts: 71
Thanks: 23
Thanked 0 Times in 0 Posts
Default GridView changes

Hi Folks, I have a gridview associated with a sqlDataSource and in the gridview I changed some of the fields to “Convert this field into a TemplateField“ which renders text boxes and allows access to change the structure of the changed fields. I have taken out the text boxes, dropped in dropdown lists, associated another sqldatasource with the dropdown lists and changed data bindings. All of which worked fine until I slightly changed the data source of the gridview (I added another table and inserted one column from the new table). I have found that changing the data source makes my gridview revert back to its original structure, taking out all my dropdown lists.

Is this to be expected or am I doing something wrong. Note I changed the sqldatasource of my gridview by selecting configure data source from my gridviews smart task pane.

Many Thanks
Mark
Reply With Quote
  #2 (permalink)  
Old February 8th, 2013, 06:18 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi Mark,

When you make the changes to the data source, Visual Studio as you if you want to reset key and other information. When you answer yes, you get the behavior your describe below. When you answer no, your gird's code should not be touched.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
markhh (February 8th, 2013)
  #3 (permalink)  
Old February 8th, 2013, 07:21 AM
Authorized User
Points: 303, Level: 6
Points: 303, Level: 6 Points: 303, Level: 6 Points: 303, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: , , United Kingdom.
Posts: 71
Thanks: 23
Thanked 0 Times in 0 Posts
Default

Hi Imar Hope you are well, yes that is right I did answer yes when prompted to reset, many thanks again for your informative and prompt reply,

Regards
Mark
Reply With Quote
Reply


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
The GridView 'GridView' fired event PageIndexChanging which wasn't handled Phil Critchley ASP.NET 4 General Discussion 10 February 19th, 2011 09:55 AM
gridview nested gridview phuchoang2583 ASP.NET 3.5 Basics 0 January 26th, 2011 12:08 AM
Copy One Row from Gridview to Gridview lvprasad2007 ASP.NET 2.0 Professional 0 July 28th, 2009 08:29 AM
GridView pady123 ASP.NET 2.0 Professional 0 November 13th, 2008 05:48 AM
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM



All times are GMT -4. The time now is 08:38 AM.


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