Change GridView to Edit Mode

29 views
Skip to first unread message

Ana

unread,
Dec 22, 2009, 6:24:04 PM12/22/09
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hi,

I have a GridView with seven columns of data and in the eighth column
I have two linkButtons: EditButton and DeleteButton. The GridView is
being bound in the code behind.

When I click on EditButton, the row [corresponding to the row in which
the button I clicked is] is supposed to change to edit mode. I'm
having a hard time trying to do this. My last try was using this code:

Protected Sub EditButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim row As GridViewRow = sender.parent.parent
row.RowState = DataControlRowState.Edit
BindMyGridView()
End Sub

But nothing happens. ANy suggestions of how to achieve my goal?

Thanks,

Ana

vinay kumar

unread,
Dec 23, 2009, 2:34:43 AM12/23/09
to dotnetde...@googlegroups.com

ARUN KUMAR

unread,
Dec 26, 2009, 10:57:41 AM12/26/09
to dotnetde...@googlegroups.com

I don’t your scenario but I have change your code like below this code change your grid view to default edit mode

 
Protected Sub EditButton_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
       sender.EditIndex=e.RowIndex
       BindMyGridView()
End Sub
2009/12/23 Ana <drumond.a...@gmail.com>



  --
 Regards
 *******************
 *C.Arun Kumar *
 *******************



Charles A. Lopez

unread,
Dec 26, 2009, 4:16:31 PM12/26/09
to dotnetde...@googlegroups.com
How would you do it with One Column?

2009/12/22 Ana <drumond.a...@gmail.com>



--
Charles A. Lopez
charle...@gmail.com

Registered Microsoft Partner

New York City, NY

I'm running on Windows 7 Build 7100

Quality Software Works

ARUN KUMAR

unread,
Dec 26, 2009, 10:19:55 PM12/26/09
to dotnetde...@googlegroups.com
Set ReadOnly is True For Other columns

2009/12/27 Charles A. Lopez <charle...@gmail.com>



--
Regards
Reply all
Reply to author
Forward
0 new messages