Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2013, 05:05 AM
Authorized User
 
Join Date: Apr 2005
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
 
Old February 8th, 2013, 06:18 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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!
The Following User Says Thank You to Imar For This Useful Post:
markhh (February 8th, 2013)
 
Old February 8th, 2013, 07:21 AM
Authorized User
 
Join Date: Apr 2005
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





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





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