Groups | Blog | Home
all groups > asp.net datagrid control > november 2007 >

asp.net datagrid control : Programattically setting gridview to edit mode


Nirmal Singh
11/2/2007 1:12:36 PM
I have a button on my form which is enabled when the user selects a record
in the datagrid (I do not want an edit button for each record in the grid).
How can I force the datagrid into edit mode when the user clicks on this
button?

Nirmal

Joe Stateson
11/5/2007 8:41:34 AM

[quoted text, click to view]

Unfortunately, I see no one has answered this. I would have like to do
something very similar: Create a "new" row in the gridview, then select
(position) on that new row and go into edit mode. This would give me a
simple way to create a new row in the database.


--
======================================================================
Joseph "Beemer Biker" Stateson
http://TipsForTheComputingImpaired.com
http://ResearchRiders.org Ask about my 99'R1100RT
======================================================================
Paul Bicknell
11/5/2007 10:48:50 PM
To force the grid control into Edit mode, use the ChangeMode function like
this:-

GridView.ChangeMode(GridViewMode.Edit)

Regards,

Paul

[quoted text, click to view]

Joe Stateson
11/7/2007 9:25:22 AM

[quoted text, click to view]

unfortunately, that ChangeMode method only works in DetailsView, not
GridView, but it is a nice thing to know anyway.


[quoted text, click to view]
AddThis Social Bookmark Button