Solved

Gridview - Force into edit mode?

Posted on 2007-04-10
7
1,550 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
This video discusses moving either the default database or any database to a new volume.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now