Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 14th, 2006, 02:25 PM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Editing Updating Sorting an Unbound Gridview

I've got a Gridview on an ASP.net page. I can't bind it because there are also unbound controls on the page (and binding them messes up the connection).

All I want to do is enable the neat editing,sorting and updating functionally.

It seems possible but the only code I've seen that comes close is in C# and I can't convert it.

I understand that there are a few lines that need to go into the RowUpdating Sub, RowEditing Sub etc but I can't actually get it working.

Any Ideas?

Thanks

  #2 (permalink)  
Old March 15th, 2006, 02:54 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

What is the datasource for the GridView?

Jim

  #3 (permalink)  
Old March 17th, 2006, 10:07 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The Datasource is a SelectCommand from a SQL database. I tried using the built in databinding, but the other SQL commands in my code (Some quite complex) then get messed up because of the bound data.

Ideally I'd like to be able to have some bound and some unbound (at design time) controls on the on the page, but it doesn't seem to work.

Any ideas on how I could get this to work?

  #4 (permalink)  
Old March 17th, 2006, 10:57 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

There is no reason why you cannot have both bound and unbound columns in your datagrid. What do you mean "it doesn't seem to work"?

  #5 (permalink)  
Old March 22nd, 2006, 07:20 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I started off with the difficult bits, these are things like queries that were doing calculations/lookups on the fly etc.

It all worked great.

I then got to the easier part, where I dragged a SQL datasource, dataset etc onto the form and bound it too some text/list boxes.

However, as soon as I ran it, the site wouldn't even go past the first page (the SQL datasurce control was on the 4th page)! I then removed the binding and found the site still didn't work! I located the problem to being a copy of the SQL database having been created. Once the copy was removed, the site ran fine.

I did this twice just to make sure, and it happened both times.

I really don't know what caused the problem, it was weird.

Do the standard data controls automatically create a backup of the data? Do the standard data controls open a connection as soon as the site starts? I always close the DB connection as soon as I've run a query so I think any connection conflicts must have been caused by the standard controls.



  #6 (permalink)  
Old March 22nd, 2006, 10:41 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Create backup of data? The sqldatasoure's connection opens and closes automatically when the page runs and the control is bound.

 


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
Editing all GridView rows Abbas ASP.NET 2.0 Professional 4 March 3rd, 2012 02:19 PM
bulk editing in gridview tam_soft ASP.NET 2.0 Basics 0 November 27th, 2007 04:49 AM
editing and updating a gridview sarah lee ASP.NET 2.0 Basics 2 December 22nd, 2006 05:45 AM
Editing all GridView rows Abbas C# 2005 0 November 29th, 2006 03:52 PM
Visual Basic code for Updating (Editing) DataSet11 connijean VB Databases Basics 0 May 5th, 2004 05:53 PM



All times are GMT -4. The time now is 07:10 PM.


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