Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Gridview - Force into edit mode?

Posted on 2007-04-10
7
Medium Priority
?
1,568 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Screencast - Getting to Know the Pipeline
Suggested Courses

610 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