Solved

I have an edit button set up as a template field within a gridview and i want to edit that row if it is clicked but it is not firing the rowcomand event in the gridview.

Posted on 2014-11-28
2
151 Views
Last Modified: 2014-12-01
aspx file:

<asp:TemplateField>
              <ItemTemplate>
                    <asp:Button ID="edit" runat="server"
                        CommandName="EditMilestones"
                        CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                        Text="Edit" />
                </ItemTemplate>
            </asp:TemplateField>

code behind file

Protected Sub GrdVisualObjectives_RowCommand(ByVal sender As Object, _
          ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)
        If (e.CommandName = "EditMilestones") Then
            ' Retrieve the row index stored in the CommandArgument property.
            Dim index As Integer = Convert.ToInt32(e.CommandArgument)

            ' Retrieve the row that contains the button
            ' from the Rows collection.
            Dim row As GridViewRow = GrdVisualObjectives.Rows(index)

            ' Add code here to add the item to the shopping cart.

        End If
    End Sub
0
Comment
Question by:MartinChadderton
2 Comments
 
LVL 5

Accepted Solution

by:
ashokpumca earned 500 total points
ID: 40471501
0
 
LVL 1

Author Comment

by:MartinChadderton
ID: 40473383
It did
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
WEB Farm 6 26
Form design in vb.net 7 20
Make a border less form movable 2 14
VB.NET HttpWebRequest 12 34
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now