rowcommand

Union two List

Hi there, i want to union, merge in a List that contains both references, so this is my code, how can i define a list ready for this porpouses ? if (e.CommandName == "AddtoSelected") { List<DetalleCita> lstAux = new List<DetalleCita>(); foreach (GridViewRow row in this.dgvEstudios.Rows) ...

Detecting a Refresh Operation Immediately Following a RowCommand Event

Hi All. ASP.Net 2.0 The scenario: I have a gridview with a template column with a custom rowcommand image button. In short, the rowcommand fires some code behind which inserts a row into a SQL table with some unique values, then does a RegisterStartupScript which does a window.open. The page in the window.open logs a user in using ...

Index out of range error when using row.FindControl inside a Asp.net Gridview rowcommand event with Paging Enabled

The following code works great on Page 1 of data inside an Asp.net Gridview control: If e.CommandName = "Void" Then 'Read the status of the ticket currently Dim RowIndex As Integer = CInt(e.CommandArgument) Dim row As GridViewRow = grdTradeTickets.Rows(RowIndex) Dim lblTransactionID As Label = Dire...

GridView cell not registering any controls on RowCommand event

First off, I realize most of this can also be done using ItemTemplates. If what I'm trying to do simply isn't possible, I will consider using them instead. Here are the basics of my dilemma: I have a GridView in the ASPX page that is loaded in the CodeBehind. Each row contains a couple of buttons that trigger the OnRowCommand event. Wh...

How to I call a javascript function on onrowcommand?

Using asp.net, c# 3.5, vs 2008. I have an aspx gridview called gv1 with a working c# codebehind onrowcommand method which is called when a button on the row is clicked. The button on the gridview is being dynamically generated. I am trying to replace that codebehind call with a javascript function to avoid a roundtrip to the server....

GridView Template - How to Grab Data from Selected Row

<asp:TemplateField> <ItemTemplate> <table width="540" cellpadding="5"> <tr> <td align="left" style="width:60%;"> <img src='PurchaseHandler.ashx?ProductID=<%# Eval("ProductID")%>' alt="<%# Eval("ProductName") %>" /> </td> <td align="left"> ...

ASP.Net GridView - Update Row Command does not revert back to display-only

I have a GridView that is populated from a LinqDataSource. When I update a row, the RowCommand fires and the change is persisted to the database, but the Grid does not refresh. I have it in an UpdatePanel and explicitely call Update() in the RowCommand handler, but there is no postback and the page just sits there in Edit mode. Once I cl...

Get DataKey values in GridView RowCommand

I have a GridView with an associated DataKey, which is the item ID. How do I retrieve that value inside the RowCommand event? This seems to work, but I don't like the cast to LinkButton (what if some other command is firing the event?), and I'm not too confident about the NamingContainer bit. LinkButton lb = (LinkButton)e.CommandSource...

Gridview Usercontrol in multiview:RowCommand fire only in first view

Hi I have a Gridview inside a usercontrol with a rowcommand event. this usercontrol is loaded dynamically into every view in multiview. when I click on the imagebutton inside the gridview, the rowcommand will fire only in the first view. when I select the second view and clicking the imagebutton, then this view will be empty (the use...

Grindview with imagebutton and rowcommand

hello guys, i know this a frequently asked question, but i cant find the solution. I hope u can help me. i try ti bind imagebutton controls into a gridview. i want to handle the data for the row where the button was clicked my aspx file looks like <asp:ImageButton ID="Button1" runat="server" ...

RowCommand in GridView raises multiple events on click

A nice good afternoon from Germany, I have a asp:GridView and ButtonFields on the row with a RowCommand event. protected void gridView_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "FirstButton": this.DoSomething(); break; case "SecondButton": ...