Solved

Gridview - Force into edit mode?

Posted on 2007-04-10
7
1,552 Views
Last Modified: 2008-01-09
I have a gridview and need to force it into edit mode on page load - how is this done?
0
Comment
Question by:tbaseflug
  • 3
  • 2
  • 2
7 Comments
 
LVL 19

Expert Comment

by:DreamMaster
ID: 18882628
Ok, now I am a bit confused. Do you want to force the gridview to be in edit mode for every line that is in the gridview? Or do you want it to open with the last row in edit mode, or a new row in edit mode...

For the first option, I'd say you're out of luck. Gridview is just not made for that, unless you make your own. Second could be possible as could be the third..

Regards,
Max.
0
 

Author Comment

by:tbaseflug
ID: 18882640
Correct - I am looking for the 1st - want to the Gridview to open in in multi-row edit mode - so that all rows are editable
0
 
LVL 4

Expert Comment

by:CBeach1980
ID: 18882689
To have a gridview in multi-row edit mode you could create a new gridview with TemplateColumns that have textboxes in the ItemTemplate and then on save you'd need to loop through all the textboxes to get the values.  You could then have a display version of your gridview that just uses Labels.
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:tbaseflug
ID: 18882761
There is no way - on page load or something, to force the gridview from display into edit?
0
 
LVL 4

Expert Comment

by:CBeach1980
ID: 18882810
You can force it into edit mode for a single row but not for the entire grid.  Gridviews are designed to only have one row editable at a given time.  To force a single row you set GridView.EditIndex to the row you want to edit before you databind.
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 500 total points
ID: 18883909
Like I said, for option number one you are out of luck, unless you create your own gridview derived from the original, that would allow for such a thing. The gridview is designed for displaying data, and editing one row at the same time. It isn't even designed for inserting rows, although that can be overcome quite easily.

So you are left with the option of either altering the gridview to suite your needs, or accepting the fact that the standard gridview is not designed for full editting capabilities.

Regards,
Max.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 18884513
Glad to have been helpful :)
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question