473,383 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

grideview's OnRowUpdating event not fire

wei
Hello all
this is problem I worked a few hours without answer,
this is my gridview control-------

<asp:GridView ID="gview" runat="server"
Width="710px" AutoGenerateEditButton =true OnRowUpdating ="OnRowUpdate"
AllowPaging ="false" AutoGenerateColumns ="false"
AllowSorting ="false" OnRowEditing="OnRowEdit" OnRowCancelingEdit
="OnRowCancel"
EnableViewState="false" DataKeyNames ="ATTR_KEY"
GridLines="None">

-------
my "Edit" and "Cancel" event are working just fine, but "OnRowUpdating "
never fired when I click "Update", I double checked spell and everytihg, but
still not work
this is function for update

protected void OnRowUpdate(object source, GridViewUpdateEventArgs e)
{
string strUpdte ="UPDATE ";
if (e.NewValues["WPA_ITEM_TX"] != e.OldValues["WPA_ITEM_TX"])
{
strUpdte = e.NewValues["WPA_TEM_TX"].ToString();

}
DOSOMETHING....
gview.EditIndex = -1;
int clntKey = Convert.ToInt32(ddList.SelectedValue);
gview.DataSource = myUser.GetWpa(clntKey);
gview.DataBind();

}

it never hit the first line of this function when I try to debug

any ideas

thanks

Mar 31 '06 #1
1 3806
wei
Ok, I know what wrong, I forget to set "EnableViewState=true",

"wei" wrote:
Hello all
this is problem I worked a few hours without answer,
this is my gridview control-------

<asp:GridView ID="gview" runat="server"
Width="710px" AutoGenerateEditButton =true OnRowUpdating ="OnRowUpdate"
AllowPaging ="false" AutoGenerateColumns ="false"
AllowSorting ="false" OnRowEditing="OnRowEdit" OnRowCancelingEdit
="OnRowCancel"
EnableViewState="false" DataKeyNames ="ATTR_KEY"
GridLines="None">

-------
my "Edit" and "Cancel" event are working just fine, but "OnRowUpdating "
never fired when I click "Update", I double checked spell and everytihg, but
still not work
this is function for update

protected void OnRowUpdate(object source, GridViewUpdateEventArgs e)
{
string strUpdte ="UPDATE ";
if (e.NewValues["WPA_ITEM_TX"] != e.OldValues["WPA_ITEM_TX"])
{
strUpdte = e.NewValues["WPA_TEM_TX"].ToString();

}
DOSOMETHING....
gview.EditIndex = -1;
int clntKey = Convert.ToInt32(ddList.SelectedValue);
gview.DataSource = myUser.GetWpa(clntKey);
gview.DataBind();

}

it never hit the first line of this function when I try to debug

any ideas

thanks

Apr 3 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Maxine G | last post by:
I have two forms, a menu and a data entry form. The entry form is bound to a query against linked SQL server tables. In the deactivate event, I have some code which asks the user if they want to...
18
by: Elder Hyde | last post by:
Hey all, A class of mine needs to tell the outside world when its buffer is not empty. The problem is that C# seems to force you to put the event-raising code in the base class. To illustrate,...
5
by: Carlo Marchesoni | last post by:
From an aspx page (A.aspx) I open another one (B.aspx - for table lookup). When the user selects an entry in B.aspx I would like to force a button's event in A.aspx to be fired. I guess the only...
5
by: Verde | last post by:
This is admittedly an apparently odd request... but please indulge me if you don't mind: Suppose I have two <asp:Button.../> on a page (Button1 and Button2). User clicks Button1 and triggers a...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
1
by: ma | last post by:
Hello, I have a grideview which is bound to a database. I want that based on the value of one field on the database one image is shown in the gideview. For example assume that I have a field in...
0
by: rakeshpatil1234 | last post by:
hi i want to click into grideview and get that row value in the textboxes can anybody help me plz?
0
by: senglory | last post by:
I have the following ASPX: <asp:GridView ID="ctlAllocations" runat="server" OnRowEditing="ctlAllocations_OnRowEditing" OnRowDeleting="ctlAllocations_OnRowDeleting"...
0
by: Jeff | last post by:
hi asp.net 2.0 I'm having problem updating a GridView. The problems is that the website complains it don't find the update method. The problem is caused by the updateparameters. The...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.