Cannot delete columns of GridView by using "Edit Columns..."

Hi all,

I have a GridView with quite a few auto-generated fields. When I go to GridView Tasks to use "Edit Columns..." to delete a few columns, the design window shows the columns removed just as expected. However, the source code does not change at all. If I save the .aspx file and reopen it, it shows all the deleted columns like nothing has changed.  I can go to the source code to delete the fields and the deletion will stay.  I am using VS 2008 standard edition.

Could anyone shed some light on this?

 


Hong
0
zipswich
11/9/2008 3:07:19 AM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

6 Replies
448 Views

Similar Articles

[PageSpeed] 52

Hi,

In the gridview have some Bound fields from edit column...

In the data field property give the name of column that is present in the database that u r using, give them appropriate name in header text...

And take only bound fields as required...(eg if i have 3 columns from database viz, sr.no, Name, Surname, etc and i want only Sr.NO, Name. I will take two bound fields and will give datafield as from database and will remove the auto generate check box to unchecked...)

May this will help you...

Happy coding...


---
Shaan
0
shaan
11/10/2008 5:33:36 AM

I think I know what you're talking about, it annoys the heck out of me too.

Before you switch to Source view (or Split mode) click the little tag above the control (or a parent tag, or all of them). It’s at the top-left of the control and has a yellowish background.

That's supposed to update the source view with the changes you made in design view. (I can't always get it to work as advertised though, especially on my extremely complex forms).

 

Editorial: While I'm not impressed by the performance or quality of VS 2008, it's still a heap better than 2005. Heck, I'm an old-school Visual InterDev 1.0 developer. I actually worked at Microsoft Developer support back in the day, and that thing was real bad. Then they came out with Visual InterDev 6, which was a huge improvement. And now they have VS 2008 (and .Net) which is light-years beyond anything we could have imagined back then. All I’m saying is be thankful for what we have. It may not be perfect, but perfection is impossible, right? Stick out tongue

 


There are no stupid questions, only easy answers. However, the quality of assistance you receive (if any) is directly proportional to the quality of your request.

p.s. Please remember to "mark as answer" all posts that answer your question.
0
CharlesF
11/10/2008 5:47:25 AM

Thanks, Shaan and CharlesF.

CharlesF, your method works!  I assume this is VS bug because I cannot figure our a rationale for requiring this extra step to save the change.

I have other minor issues with VS 2008, but what's the alternative? For what we need to do, it is the best we've got. 

Thanks again.


Hong
0
zipswich
11/10/2008 12:27:49 PM

Yeah, I assume it's a bug as well. It's not the only bug either, there are plenty. One that requires you to restart VS that I run into all the time.

As for this bug, I haven't figured it out exactly.

On my more complex forms it seems that if I just wait (even though there is no indication Visual Studio is "working") it eventually catches up. Other times I click other tags on other controls, click inside a control, click outside of it, and wait for it to update (a long time) it eventually updates the source view. I haven't figured out exactly the combination that works every time. (if just clicking the tag doesn't do it)

I just juggle around with it for a while until the source code gets updated. Sometimes though I give up and just manually make the changes in declarative. (which leaves me angry and extremely frustrated which further adds to my negative impression of Microsoft)

Lately, I've been forced to use source view almost exclusivly and stay away from design view because of this problem and VS2008's extremly poor performance. (I seem to wait for it more than I actually work). There is also a memory leak. Every once in a while Visual Studio 2008 shoots up to using over 1.5 gigs of RAM! A restart takes that back down to ~530K) 

I am not happy about these bugs because my development time is increased. It is hard to explain that to the people who sign my checks. They ask the obvious question: Perhaps it is more cost effective to not use Microsoft products. Should we hire a Cold Fusion or PHP developer to build our web applications instead?

The thing is, I've worked as the Senior Software Architect for this company for over 8 years now. When I started I was developing Classic ASP applications for them. And right now, ASP.Net applications are taking LONGER to produce than the old Classic ASP applications. The people who sign my checks do not appreciate having to fork over so much money to supply our entire team with Visual Studio 2008 only to have the over-all development time increased. (which loses them money)

All I have to say is that Microsoft better fix these serious bugs in Visual Studio 2010 or many of us may be out of a job.

 

-Charles


There are no stupid questions, only easy answers. However, the quality of assistance you receive (if any) is directly proportional to the quality of your request.

p.s. Please remember to "mark as answer" all posts that answer your question.
0
CharlesF
11/10/2008 6:36:37 PM

Charles, I agree with everything you wrote.

My VS 2008 sometimes mysteriously closes.  For complex forms, using only design view is not a feasible option. To configure a specific control, I still like to use the design view whenever I can.

Thanks again.


Hong
0
zipswich
11/10/2008 9:18:57 PM

I think I figured out a quicker work-around to the VS 2008 bug not udating source code (declarative) when a change is made in details view...

Rather than just click that yellow control tag in design view, hold it and drag it. (even if it's just one space over) That causes their engine to re-write the entire tag (in a new location in source view) and in doing so it updates changes you've made in design view to source view.

So far this has worked for me every time the bug occurs.


There are no stupid questions, only easy answers. However, the quality of assistance you receive (if any) is directly proportional to the quality of your request.

p.s. Please remember to "mark as answer" all posts that answer your question.
0
CharlesF
11/11/2008 8:02:33 PM
Reply:

Similar Artilces:

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

.ALLCOL("%COLUMN%", " ", ", ", ", ")
Do you know anyway for me to exclude a subset of columns returned by this function. We have two columns (rec_user and rec_datetime) which are in all of our tables, but when generating triggers I want automatically generate a script which does not include those two columns but does include all other columns in that table. Bruce I should add that I am using PD 9.0.0.580. Bruce "Bruce Lamb" <lamb.bruce@mayo.edu> wrote in message news:6HgI315nCHA.155@forums.sybase.com... > Do you know anyway for me to exclude a subset of columns returned by this > function. ...

Creating dropdownlist in gridview without using "edit" column?
I'm looking to create a dropdownlist on each row of a gridview.  When the user changes a dropdownlist value in a particular row, I want to do an autopostback.  This autopostback updates that row in the database and then repopulates the grid displaying new values for that particular row. I'm able to perform an autopostback, but I'm unable to retrieve the dropdownlists value nor am I able to determine the row within the gridview the user tried to update. Anyone know how I can do these two actions? Thanks in advance. -Goalie35 do it in gridview_rowcommand pass the va...

Possible to use graphic instead of "Edit" text for GridView column?
Is it possible to use an icon instead of the "Edit" text for a GridView column with AutoGenerateEditButton="True" or do I have to use a Template column instead? There's a 3rd option between the 2 you mentioned: use a CommandField and set the "EditImageUrl" property.Hope that helps!Marciehttp://www.datagridgirl.comNEW! http://www.gridviewgirl.com Could provide a little pseudocode?  Can I do this if I'm using a DataSource?Thanks OK, I added a CommandField and set it's EditImageUrl property to a .gif icon but it didn't display.  I should add that this is inside a dotnetnuke mod...

How to format a column filed in a GridView using the "Edit DataBindings" Format property?
I have some amounts which are brought from a SQL database, the problem is that they are saved as strings and the last two positions from those strings corresponds to cents. e.i. 45098  should be formatted as 450.98.right now I am using a SqlDataSource to fill that GridView, and the amount field brings the values as they as varchars.  I would like to know which format I should Apply to the label databinding property once I convert that field to a template field.I tried {0:c} but didnt do anything. The obvious question is whay aren't you saving the values as numbers?  If that ...

Why I cannot use "delete" and "edit" functions ???
Hi all,This application was hosted at remote site.  I had a problem when I try to delete or edit or rename  my Album or Photo  after I logged in as  administrator.  I already checked all parameters for matching from both PhotoManager.cs class and all store procedures from Personal.mdf database.  Each parameter is matching each other.  But I still do not know why I got those problems above.  But when I add a new album, it is ok. There is no problem for adding a new album.   I use C# version.  I hosted this application at www.vwdhosting.ne...

Where can I get the images used by VS2005 for "Edit, Update, Cancel"; "Select"; and "Delete"
I'm looking for small, elegant images to use in the CommandField of a GridView for Edit, Delete, and Select. Visual Studio 2005 uses images that would be perfect but I don't know where to get the files for these images so I can use them in my own project. From a GridView's Smart Tag, go to GridView Tasks | Edit Columns | Available Fields. Under CommandField there is a sub-tree with three images that are just what I need: "Edit, Update, Cancel"; "Select"; and "Delete". Does anyone know where I can find the files for these three images (.bmp, ,gif, etc.)?     I d...

Bound GridView. Change column display from "P" to "Person"
I have an ASP.NET VS 2008 project that uses a bound GridView. (ASPX code is below)One of the columns displays the "Type" field, which is a single character "P", "S", "C", or "O".Instead of displaying the single character, I'd like to display "Primary", "Spouse", "Child", or "Other".I'm sure that this can be done with templates, but I can't figure it out.  Can someone help me set up the template to accomplish this?Thanks!  HBH' ********************* SQL Data source *************...

superreview requested: [Bug 348668] attribute "nodeName" column needs to be split up in "prefix" and "localName" columns : [Attachment 233705] v1.0
Shawn Wilsher :sdwilsh <comrade693@gmail.com> has asked neil@parkwaycc.co.uk <neil@httl.net> for superreview: Bug 348668: attribute "nodeName" column needs to be split up in "prefix" and "localName" columns https://bugzilla.mozilla.org/show_bug.cgi?id=348668 Attachment 233705: v1.0 https://bugzilla.mozilla.org/attachment.cgi?id=233705&action=edit ------- Additional Comments from Shawn Wilsher :sdwilsh <comrade693@gmail.com> Why not...this is trivial, and seems beneficial (if I'm wrong, timeless will tell me anyway). I clea...

superreview granted: [Bug 348668] attribute "nodeName" column needs to be split up in "prefix" and "localName" columns : [Attachment 233705] v1.0
neil@parkwaycc.co.uk <neil@httl.net> has granted Shawn Wilsher :sdwilsh <comrade693@gmail.com>'s request for superreview: Bug 348668: attribute "nodeName" column needs to be split up in "prefix" and "localName" columns https://bugzilla.mozilla.org/show_bug.cgi?id=348668 Attachment 233705: v1.0 https://bugzilla.mozilla.org/attachment.cgi?id=233705&action=edit ------- Additional Comments from neil@parkwaycc.co.uk <neil@httl.net> Although I'd prefer to see nodeName restored. ...

What UpdateMethod="" should I use to allow Editing of fields in "User_List.aspx" GridView ?
I am trying to modify the GridView located at "User_List.aspx" to allow Editing of fields, similar to how the ProjectListGridView in TimeEntry.aspx does.  The GridView in TimeEntry.aspx uses SelectMethod="GetTimeEntries" and UpdateMethod="UpdateTimeEntry" for this purpose. Nevertheless, in the case of "User_List.aspx" I don’t know what I should use as UpdateMethod??. Please Help. (I do know I must use "GetAllUsers” as SelectMethod).  (NOTE: Looking at System.Web.Security.Membership class using Object-Browser, I see there is an UpdateUser(System.Web.Security.Membersh...

superreview requested: [Bug 391979] -moz-column-width in "ch" units triggers "ASSERTION: column-count and column-width can' t both be auto" : [Attachment 293370] Patch rev. 1
Mats Palmgren <mats.palmgren@bredband.net> has asked Robert O'Callahan (:roc) <roc@ocallahan.org> for superreview: Bug 391979: -moz-column-width in "ch" units triggers "ASSERTION: column-count and column-width can't both be auto" https://bugzilla.mozilla.org/show_bug.cgi?id=391979 Attachment 293370: Patch rev. 1 https://bugzilla.mozilla.org/attachment.cgi?id=293370&action=edit ------- Additional Comments from Mats Palmgren <mats.palmgren@bredband.net> Make nsColumnSetFrame deal with 'ch' unit for -moz-column-width/gap. ...

superreview granted: [Bug 391979] -moz-column-width in "ch" units triggers "ASSERTION: column-count and column-width can't both be auto" : [ Attachment 293370] Patch rev. 1
Robert O'Callahan (:roc) <roc@ocallahan.org> has granted Mats Palmgren <mats.palmgren@bredband.net>'s request for superreview: Bug 391979: -moz-column-width in "ch" units triggers "ASSERTION: column-count and column-width can't both be auto" https://bugzilla.mozilla.org/show_bug.cgi?id=391979 Attachment 293370: Patch rev. 1 https://bugzilla.mozilla.org/attachment.cgi?id=293370&action=edit ...

Get "delete" answer before delete "File" in GridView
Hi,   I got a Image gridview in a page. There is one delete button column to delete record. It is no problem to delete data in the database, but what I need is delete the image file as well if user click "OK" from the confirmation dialog. How can I get the "answer" whether user is click "OK" button or "Cancel" button? This is my code for delete the image record. OnClientClick="return confirm('Are you sure you want to delete this record?');" So, what method I should use for delete the image file? RowDeleting or RowDeleted. Protected Sub GridView1_RowDeleted(ByVal sender As Obj...

Web resources about - Cannot delete columns of GridView by using "Edit Columns..." - asp.net.presentation-controls

Resources last updated: 12/27/2015 8:04:39 PM