Solved

Gridview - Force into edit mode?

Posted on 2007-04-10
7
1,551 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…

932 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

13 Experts available now in Live!

Get 1:1 Help Now