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
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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…

740 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