Computer Software

eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
eg: UK or Brides UK or Classical Art or Buy Music or Spirituality
 
Business & Money
Technology
Women
Health
Education
Family
Travel
Cars
Entertainment
SD Editorials
Online Guide and article directory site.
Foodeditorials.com
Over 15,000 recipes & editorials on food.
Lyricadvisor.com
Get 100,000 Lyric & Albums.
  • Business & Money
    • A Guide to Business
    • Guide to Finance
    • Ideas for Marketing
    • Legal Guide
    • Guide to Insurance
    • Lettre De Motivation
    • Guide to the Stock Market
    • Human Resource Career
    • Sales Marketing
    • Forex & Trading
    • Advertising & Marketing
    • Startup Guide
  • Technology
    • Guide to Technology
    • Cell Phones
    • Computer Software
    • IT Hardwares
    • Internet
    • Online Security
    • Cameras
    • Search Engine Optimization
    • Science & Technology
  • Women
    • Guide to Women
    • Relationship Advice
    • Marriage
    • Jewelry
    • Pregnancy
    • Fashion Style
    • Divorce Guide
    • Wedding Guide
    • Dating Guide
    • Natural Beauty
  • Health
    • Guide to Health
    • Guide to Medical
    • Plastic Surgery
    • Weight Loss
    • Sports
    • Body Wellness
    • Cancer Treatment
    • Common Illness
    • Health & Lifestyle
  • Education
    • Military Service
    • Politics and Policy
    • Arts & Humanities
    • Education and Teaching
    • Learn Languages
    • Colleges & Universities
  • Family
    • Quality Home Improvement
    • Hobbies and Interests
    • Family Guide to
    • Pet Guide
    • Loans Guide
    • Credit Cards
    • Gardening Guide
    • Home Security
    • Real Estate
    • Home Decor
    • Gift & Present
  • Travel
    • The Travel Guide
    • Adventure Travel
    • Cruise Ships
    • Beach Holiday
    • Travel Accommodation
    • Holiday Destinations
  • Cars
    • Information on Cars
    • Traffic Violations
    • Auto Insurance
    • Trailers
    • Sport Cars
    • The Bikes
  • Entertainment
    • Entertainment Guide
    • World Music
    • Photo & Video
    • Television & Games

Gridview In Edit Mode

    View: 
Here's the problem. You want to be able to edit all of the rows in the gridview at once instead of having to switch to edit mode and save one row at a time. Normally, you'd want to do this when only a couple of items need to be changed per row and not the entire row's worth of data.



You can do this easily if you make the columns that need to be edited templated columns and place editable controls in them (checkbox, textbox, etc). You can then either make these controls ?AutoPostback? controls, or you can provide a control at the bottom of the screen that triggers the update. In either case, the code you are going to write at the codebehind level is going to be the same.

For this example, we are going to assume that you only have one column that needs to be updated and that the control is a checkbox control.

One of the issues you are going to run into with this is that you'll need to know which row is associated with the control when it is updated. The easiest way I've found of dealing with this problem is by adding a HiddenField control and databinding the row Id to it. Since we are dealing with a CheckBox control, you will need to create an event handler for the Checked event. The first parameter that will be passed into this event handler will be the sender. Sender represents the control that fired the event. In this case, it will represent the CheckBox control.

The other control you'll need to retrieve is the HiddenField control that you placed next to the check box. You can retrieve this control by using the FindControl() method that is hanging off the parent control of the check box. Assuming your HiddenField control is named ?_hiddenFieldId? you can get the ID by using:

string id = (HiddenField)(((CheckBox)(Sender)).Parent.

FindControl(?_hiddenFieldId?)).Text;

Now that you have the value of the ID and the value of the checkbox, you can update your database.

del.icio.us Tags: asp.net , gridview

Technorati Tags: asp.net , gridview
More Articles from
Free Photo Gallery Software
Making A Website Html
Making Books With Children
Making Games In Flash
Making Money For Free Online
Making Money On The Side
Malware And Spyware Remover
Manage Your Own Business
Management And Consulting Services
Management Consulting In India
Management Of Information Services
Management Of Software Development
Management Software Microsoft Project
Manual And Automated Testing
Manufacturing Enterprise Resource Planning Software
Manufacturing Software Small Business
Mapping Software For Gps
Market Technical Analysis Software
Marriage Questions To Ask
Master Electrician Exam Prep
Max Secure Spyware Detector
» More on
The Best Software Writing
  • Related Articles
  • Author
  • Most Popular
•Computer In Safe Mode, by Parveenn Kumarr
•Gridview In Asp Net, by Adam Sturo
•Gridview In Edit Mode, by Dave Bush
•How Do I Start My Computer In Safe Mode, by John Pawlett
•How To Run Computer In Safe Mode, by Arvind Singh
Dave Bush has sinced written about articles on various topics from Software, Web Development and The Internet. Dave answers related questions at .NET Answers and runs a
Art Of Effortless Living
Then you can take your attention off trying to convince someone to do business with you. You can relax and get interested in them and see if theyre ready to change and take action
 
A Guide to Business | Guide to Technology | Guide to Women | Guide to Health | Family Guide to | Travel & Vacations | Information on Cars

EditorialToday Computer Software has 2 sub sections. Such as Software and All Microsoft Softwares. With over 20,000 authors and writers, we are a well known online resource and editorial services site in United Kingdom, Canada & America . Here, we cover all the major topics from self help guide to A Guide to Business, Guide to Finance, Ideas for Marketing, Legal Guide, Lettre De Motivation, Guide to Insurance, Guide to Health, Guide to Medical, Military Service, Guide to Women, Pet Guide, Politics and Policy , Guide to Technology, The Travel Guide, Information on Cars, Entertainment Guide, Family Guide to, Hobbies and Interests, Quality Home Improvement, Arts & Humanities and many more.
About Editorial Today | Contact Us | Terms of Use | Submit an Article | Our Authors