Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid Edit button Problem

Status
Not open for further replies.

dbsquared

Programmer
Nov 7, 2002
175
US
I am new to ASP.Net and I am trying to figure out why the edit event won't fire for me.
I have a datagrid on a page and I want the user to be able to edit some of the fields. so I have an edit button and in the cod e I have an edit event sub and I have it declared in my html also.
here is my code
Code:
Sub dgRed_Edit(ByVal sender As System.Object, ByVal e As DataGridCommandEventArgs) Handles dgRed.EditCommand
        lblTest.Text = "Click: Detected"
        dgRed.EditItemIndex = e.Item.ItemIndex
        adpRed.Fill(DsDirec1, "tblDirectorCommentsRed")
        dgRed.DataBind()
    End Sub
Here is what I have in the html part
HTML:
<asp:DataGrid id=dgRed style="Z-INDEX: 101" runat="server" ForeColor="Red" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" BackColor="White" CellPadding="3" GridLines="Vertical" DataSource="<%# DsDirec1 %>" DataMember="tblDirectorCommentsRed" AutoGenerateColumns="False" 
OnEditCommand="dgRed_Edit" >
I have a label on the page to see even if the edit event is firing and it isn't can someone help me. Thanks

To go where no programmer has gone before.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top