Questions tagged [rowcommand]

Use RowCommand event if you have problem related Button like controls)'s click event inside asp:GridView.

The RowCommand event is raised when a button is clicked in the GridView control. This enables you to provide an event-handling method that performs a custom routine whenever this event occurs.

Buttons within a GridView control can also invoke some of the built-in functionality of the control. To perform one of these operations, set the CommandName property of a button to one of the values in the following table.

Syntax: public event GridViewCommandEventHandler RowCommand

See usage example here.

102 questions
0
votes
0 answers

OnRowCommand doesn't work: Clicking the button in my gridview is not intercepted

Clicking the button (btn_goToPoint) in my gridview is not intercepted. There is a load but the redirection does not work. When I put a breakpoint in the back code (grd_points_rowCommand), the code is not executed there. Before when I clicked on the…
baker
  • 35
  • 1
  • 9
0
votes
0 answers

GridView RowCommand is not firing on click edit / delete in asp.net c#

I have a Asp Gridview Control with OnRowCommand .i have asp:ButtonField for edit / delete the values. When I click the any one of the button protected void gvStaffList_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName ==…
Karthik KM
  • 33
  • 2
  • 10
0
votes
4 answers

Gridview RowCommand not working

I am having problems trying to get a rowcommand event to fire in a gridview. I followed the code example from MSDNet but I cannot figure out why it is not working. The code is below. Thank you.
Mike
  • 713
  • 6
  • 20
  • 41
0
votes
0 answers

C# PostBack Issue

I'm having some issues with posting back a RowCommand from a GridView. Not sure if my logic is correct so if somebody could point out where I am going wrong that would be great. It seems there are lot of similar problems but none of the solutions…
ScottC
  • 162
  • 1
  • 14
0
votes
1 answer

ASP.NET - Get DropDownList SelectedValue for current Row when using RowCommand

When I run the row command event from a button on a gridview row I can detect the correct value from any field found on the eventrow. hidID which is a unique identifier reports correctly for each row as expected. ddlVal always reports the first…
DreamTeK
  • 32,537
  • 27
  • 112
  • 171
0
votes
1 answer

GridView RowCommand copy to clipboard the e.CommandArgument Value

Protected Sub GridView_Paga_AT_0_RowCommand(sender As Object, e As GridViewCommandEventArgs) If e.CommandName = "C_Nif" Then Dim row As GridViewRow = DirectCast(DirectCast(e.CommandSource, Control).NamingContainer, GridViewRow) …
0
votes
2 answers

ASP.Net nested GridView OnRowCommand not firing

I've tried all the suggestions I've found here and elsewhere. I've set EnableViewState to true and false for the page. I've set EnableViewState to true and false for the grids. I've tried registering the events for the child grid in the parent grid…
Chris
  • 650
  • 7
  • 20
0
votes
1 answer

Get column index of clicked column in gridview

When a button in the footer is clicked how can the HeaderText or ColumnIndex or the clicked column be checked? GRIDVIEW
DreamTeK
  • 32,537
  • 27
  • 112
  • 171
0
votes
1 answer

Why doesn't row command properly work?

I have a download function getting called in ROWCOMMAND of gridview. It works when I click it but stops working if I click(call) another function in rowcommand. It doesn't throw exception. I tried debugging every step but no luck. Why ? Download…
Cuckoo
  • 177
  • 1
  • 2
  • 10
0
votes
1 answer

GridView RowCommand Not Firing at all for image button

Iam trying to fire rowCommand event on Image button click in my GridView. The GridView is inside Update Panel. But after trying all the means like: EnableViewState, Binding Grid on IsPostback, Iam not able to get the exact reason. Please find the…
rp4361
  • 433
  • 1
  • 5
  • 20
0
votes
0 answers

get value from string or store in database?

this is my viewcreditrequest html page:
Paolo Duhaylungsod
  • 487
  • 1
  • 7
  • 25
0
votes
3 answers

C# - Gridview Help. (ASP.NET)

I have a gridview that pulls data from local SQL server. I chose 3 columns to be displayed on the gridview. I added a fourth column (select command). I would like to get the data from the first column which is an id when I click the select command…
Ali Aziz
  • 1
  • 1
0
votes
0 answers

Why my code fails to access parent gridview in rowcommand?

I have a ParentGridview which contains ChildGridview inside a Panel and inside an **ItemTemplateField**. Now in coding I want to get the ParentGridview and via that I want to access that Panel but can't achieve. aspx: (*Don't go with the syntax, i…
Stacky Flowy
  • 103
  • 1
  • 10
0
votes
1 answer

Row command not working in gridview

Hi I am using following code to display a grid on aspx
0
votes
0 answers

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index gridview

My grid has only one row (always) based on unique condition in database. When I try to edit using Rowcommand am getting error as "Index was out of range" Here is grid code and asp.net code: protected void grdedittemplate_RowCommand(object sender,…
Hari Mohan
  • 23
  • 1
  • 7