how do I get the row index of the row that was just updated in the row_updated function?

How do I get the row index of the row that was just updated in the row_updated function?  Please don't tell me to use the row updating function because I tried to do what I want under row_updating but it doesn' t work for what I need to do.



1/19/2008 8:37:02 PM 72751 articles. 3 followers. Follow

2 Replies

Similar Articles

[PageSpeed] 26

Please don't tell me to use the row updating function

Sorry, but that's where the information is:

    int LastRowUpdated;

    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        LastRowUpdated = e.RowIndex;
    protected void GridView1_RowUpdated(object sender, GridViewUpdatedEventArgs e)
        Response.Write("RowUpdated!  Index: " + LastRowUpdated.ToString());
Steve Wellens

My blog
1/20/2008 12:04:24 AM

Hi ,

Please specify which control is it.  

1/20/2008 3:37:55 AM

Similar Artilces:

How to get the row index of a selected row in listview control
Can someone please tell me how to get the index of a selected row in a listview.  <ItemTemplate> <asp:LinkButton runat="server" class="linkButton" id="xxxxx" Text='<%#Eval("documenttype") %>' CommandName="OpenFile" CommandArgument='<%#Eval("DocumentKey") %>'></asp:LinkButton></ItemTemplate>what you have to do is, in itemcommand event of ListView, you have to get the value of row indexif(e.CommandName == "corrospondingcommaandname"){     &nb...

How to delete row from GridView control
Hello,  I am working on an ASP.NET 2.0 app, and I am trying to wire up a "Delete" button to a gridview control on a form. Here is the code for the ASP :  <asp:GridView ID="gvInConditions" runat="server" AutoGenerateColumns="true" OnRowDeleting="gvInConditions_RowDeleting" DataKeyNames="Condition_ID" >         <Columns>                <asp:CommandField ButtonType="Button" SelectText=&...

Get row index of found row
How do I find the row index after searching a Dataset Table? For example, <code> Dim recId As String = Request.QueryString("r") Dim r As DataRow Dim tbl As DataTable = ds.Tables("drivers") tbl.PrimaryKey = New DataColumn() {tbl.Columns("recId")} If NOT IsNothing(tbl.Rows.Find(recId)) Then                r = tbl.Rows.Find(recId) End If </code> Next, I want to know the row index of the row, r, so the user can move foward and back, from this point, through the rows in the table, in order to display...

Row updating, row updated confusion
Okay this is the first time I've ever had to do code behind for row updating logic in a gridview. So be patient with me if it's totally incorrect. Do I put the gridview rebind code in the Row Updating or Updated event?  Currently, I have it in both as I'm simply troubleshooting to try to get it to work.  With this code, not only is the record not updating but the record disappears from the gridview upon refreshing.Protected Sub GridView2_RowUpdated(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdatedEventArgs) Handles GridView2.RowUpdated ...

get row index of row from datatable from primary key
How get row index of particular row from datatable for eg.        i have create table of following column and fill rows in that and bind it into gridview            now i want to get row index of selected row from column LedgerDetailID , how and reply me             DataTable tbl = new DataTable();            tbl.Columns.Add(new DataColumn("Index", System.Type.GetType("System.Int32"))); ...

To get the row index of selected row in grid view
Hi I have a grid view with a column of checkboxes. if I check a checkbox all the remaining checkboxes should be unchecked except the current one.protected void chkHeadCoach_CheckedChanged(object sender, EventArgs e) {foreach (GridViewRow rowitem in grdv.Rows) {CheckBox chkHeadCoach = (CheckBox)(rowitem.FindControl("chkHeadCoach"));if (chkHeadCoach.Checked) {if(rowitem.RowIndex != //row index of the row I checked now) {chkHeadCoach.Checked = false; } } } how can I get the row index of the row I checked now? }Thanks & Regards,Abhiram Reddy Mekha. AbhiramReddyMekh...

Add new controls to a gridview row; when editing that row using the edit row feature in the gridview control.
Hi all  I have a questions that looks hard / complex to me, and i know you can help me in this. Q {  I have row in a Gridview and i have an edit option to it. I press the edit button, to edit the values in that row and update data all the way back to the database. Now when i press the edit button, i want a drop down list to be displayed that contain values for a particular field in my grid view. (for now only plain text boxes appear.) } I hope you understand my question, all i need to do is replace the text box controls with a dropdown list when i am editing a row in ...

how can i get index of row in grid by clicking on grid row
how can i get index of row in grid by clicking on grid row Hi there,Under the selectedindexchanged event of the gridview put this:protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { int index= GridView1.SelectedIndex;//to get the indexGridViewRow row= GridView1.SelectedRow; //to get the selected row} thanks,Murthy Dont forget to click "Mark as Answer" on the post that helped you. This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped. Once you get the index of the row, how do ...

question about updating a row? How to update a different row.
I will try to make this as simple as I can. k, here I go. I originally populate my datagrid with data. Then during the edit mode, I can populate information by an ontextchanged event, which is actually bringing in a new row (essentially). My problem occurs when I try to update the data. Since the row was originally populated with the data, it updates that row in the table. But since I did an ontextchanged, I want to update that row instead. Not the original row. If I do an update, then I have two identical rows of data in my table, but with different primary keys. How can I update t...

Getting the row index of a command in gridview control
In my gridview I have a textbox and a save icon which allows a user to enter a date and click save which saves the date to the database for that record pointed to in the row. The problem I have is that I don’t know how to get the row to process the save in the codebehind. Normally I would set the command-argument equal to the product ID and then in the codebehind handle the event where the commandname matches the commandname for the save icon. I have the problem then though of not knowing which row caused the event. If I use a buttonfield, I know it sets the commandargument to the row index...

Trying to delete a row, I get "Row changed between retrieve and update."
Hi Trying to delete a row I get the following error message and can't figure out why. Please see error below and any suggestion will be appreciated. Thanks Error message and part of the script: Row changed between retrieve and update. No changes made to database. DELETE FROM q_code_cause WHERE code = 1 AND ... Ok I found the Problem! Thanks anyway "Wasap" <> wrote in message news:3f96a7a5@forums-2-dub... > Hi > > Trying to delete a row I get the following error message and can't figure > out why. Ple...

update multi row when i meant update single row

warning: update row ... is a conflict update and this row is ignored
SQL Anywhere I am synching one SQL Anywhere database to another through MobiLink, getting this warning: W. 2008-08-19 13:01:01. <17> [10037] Ignoring updated row (new values) W. 2008-08-19 13:01:01. <17> [10038] Ignoring updated row (old values) W. 2008-08-19 13:01:01. <17> [10072] The update row for table '<orders>' is a conflict update and this row is ignored. There are currently no conflict resolution scripts in place, so I would expect the default behavior of "last one in wins" rather than seeing "this row is ign...

Updating DataList Row by Row
Hello, I have a datalist on my web page which displays a list of records from my database, all the information is displayed in labels except for one which is in a DropDownBox and the user can select Yes or No.  I want to update each record individual based on the value in the dropdownbox.  My problem is currently if I change the last record to say No then all the records in the db change to No.  It is not recording the new values row by row. Anybody got ideas why? ThanksRegards,Steven I don't think is the DataList because I used in that way myself many times Post som...

Web resources about - how do I get the row index of the row that was just updated in the row_updated function? -

Resources last updated: 1/21/2016 9:59:37 PM