473,385 Members | 1,486 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,385 software developers and data experts.

datagrid update Command

Hello All,
If some one has faced a similar issue..
My datagrid Update command is not getting fired in fact it seems that the no
event fires on clicking the update link. Although the cancel and the Edit
Commmand are getting fired properly.

The One difference I have seen is that in the task bar ..on hovering on the
link the javascript for the update link seems different. I dont know if it
makes sense..

Edit Button : javascript:__doPostBack('DataGrid1$_ctl7$_ctl3','' )
Cancel buton : javascript:__doPostBack('DataGrid1$_ctl7$_ctl0','' )
Update button :
javascript:{if%20(typeof(Page_ClientValidate)%20!= %20'function'%20||%20%20Page_ClientValidate())%20_ _doPostBack('DataGrid1$_ctl7$_ctl2','')}

fyi..
I have in the HTML datagrid code OnUpdateCommand="DataGrid1_UpdateCommand"
and in Code behind..
Public Sub DataGrid1_UpdateCommand(ByVal source As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ) Handles
DataGrid1.UpdateCommand

Cheers,
siaj


Nov 19 '05 #1
4 3461
Do you add any validator control in your page?

you may show us more detailed info, such as your HTML
datagrid code.

BTH, Since you have
Handles DataGrid1.UpdateCommand behind Sub
DataGrid1_UpdateCommand(ByVal source As System.Object,
ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ), you
don't need OnUpdateCommand="DataGrid1_UpdateCommand"
in HTML code. That may trigger the event twice.

Elton Wang
el********@hotmail.com

-----Original Message-----
Hello All,
If some one has faced a similar issue..
My datagrid Update command is not getting fired in fact it seems that the noevent fires on clicking the update link. Although the cancel and the EditCommmand are getting fired properly.

The One difference I have seen is that in the task bar ..on hovering on thelink the javascript for the update link seems different. I dont know if itmakes sense..

Edit Button : javascript:__doPostBack('DataGrid1$_ctl7 $_ctl3','')Cancel buton : javascript:__doPostBack('DataGrid1$_ctl7 $_ctl0','')Update button :
javascript:{if%20(typeof(Page_ClientValidate)%20! =% 20'function'%20||%20%20Page_ClientValidate())%
20__doPostBack('DataGrid1$_ctl7$_ctl2','')}
fyi..
I have in the HTML datagrid code OnUpdateCommand="DataGrid1_UpdateCommand"and in Code behind..
Public Sub DataGrid1_UpdateCommand(ByVal source As System.Object, ByVal e AsSystem.Web.UI.WebControls.DataGridCommandEventArg s) HandlesDataGrid1.UpdateCommand

Cheers,
siaj


.

Nov 19 '05 #2
U r right sir.. thanks..
I was having a validation on a different text box on the same form(To add
user). This Text box gets visible only when user clicks on button addUser.
What was happening was that when ever I was clicking update on datagrid, post
back was happening and the validation was getting fired for the empty
UserName text box( for adduser) which is hidden.
Now the scenario appears proper , and this is how It should happen i.e
UserName textbox will be empty while I am updating a value in the grid. How
should I take care that the validation for the AddUser should get fired only
when I am trying to save new user not when postback is happening due to some
other reason in the web form(for eg in the datagrid in this case).

Will appreciate any idea..

cheers,
siaj

"Elton Wang" wrote:
Do you add any validator control in your page?

you may show us more detailed info, such as your HTML
datagrid code.

BTH, Since you have
Handles DataGrid1.UpdateCommand behind Sub
DataGrid1_UpdateCommand(ByVal source As System.Object,
ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ), you
don't need OnUpdateCommand="DataGrid1_UpdateCommand"
in HTML code. That may trigger the event twice.

Elton Wang
el********@hotmail.com

-----Original Message-----
Hello All,
If some one has faced a similar issue..
My datagrid Update command is not getting fired in fact

it seems that the no
event fires on clicking the update link. Although the

cancel and the Edit
Commmand are getting fired properly.

The One difference I have seen is that in the task

bar ..on hovering on the
link the javascript for the update link seems different.

I dont know if it
makes sense..

Edit Button : javascript:__doPostBack('DataGrid1$_ctl7

$_ctl3','')
Cancel buton : javascript:__doPostBack('DataGrid1$_ctl7

$_ctl0','')
Update button :
javascript:{if%20(typeof(Page_ClientValidate)%20! =%

20'function'%20||%20%20Page_ClientValidate())%
20__doPostBack('DataGrid1$_ctl7$_ctl2','')}

fyi..
I have in the HTML datagrid code

OnUpdateCommand="DataGrid1_UpdateCommand"
and in Code behind..
Public Sub DataGrid1_UpdateCommand(ByVal source As

System.Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArg s)

Handles
DataGrid1.UpdateCommand

Cheers,
siaj


.

Nov 19 '05 #3
Hi siaj,

If the validation only affects Update, you might use
following logic:

In EditCommand event (after that, update and cancel will
be enabled)
disable validation
(you might also disable AddUser button here)
In UpdateCommand and CacellCommand (after that, it will
return normal state)
enable validation
(enable AddUser button)

HTH

Elton Wang
-----Original Message-----
U r right sir.. thanks..
I was having a validation on a different text box on the same form(To adduser). This Text box gets visible only when user clicks on button addUser.What was happening was that when ever I was clicking update on datagrid, postback was happening and the validation was getting fired for the emptyUserName text box( for adduser) which is hidden.
Now the scenario appears proper , and this is how It should happen i.eUserName textbox will be empty while I am updating a value in the grid. Howshould I take care that the validation for the AddUser should get fired onlywhen I am trying to save new user not when postback is happening due to someother reason in the web form(for eg in the datagrid in this case).
Will appreciate any idea..

cheers,
siaj

"Elton Wang" wrote:
Do you add any validator control in your page?

you may show us more detailed info, such as your HTML
datagrid code.

BTH, Since you have
Handles DataGrid1.UpdateCommand behind Sub
DataGrid1_UpdateCommand(ByVal source As System.Object,
ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ), you don't need OnUpdateCommand="DataGrid1_UpdateCommand"
in HTML code. That may trigger the event twice.

Elton Wang
el********@hotmail.com

>-----Original Message-----
>Hello All,
>If some one has faced a similar issue..
>My datagrid Update command is not getting fired in
fact it seems that the no
>event fires on clicking the update link. Although the

cancel and the Edit
>Commmand are getting fired properly.
>
>The One difference I have seen is that in the task

bar ..on hovering on the
>link the javascript for the update link seems
different. I dont know if it
>makes sense..
>
>Edit Button : javascript:__doPostBack('DataGrid1
$_ctl7 $_ctl3','')
>Cancel buton : javascript:__doPostBack('DataGrid1$_ctl7

$_ctl0','')
>Update button :
>javascript:{if%20(typeof(Page_ClientValidate)%20! =%

20'function'%20||%20%20Page_ClientValidate())%
20__doPostBack('DataGrid1$_ctl7$_ctl2','')}
>
>fyi..
>I have in the HTML datagrid code

OnUpdateCommand="DataGrid1_UpdateCommand"
>and in Code behind..
>Public Sub DataGrid1_UpdateCommand(ByVal source As

System.Object, ByVal e As
>System.Web.UI.WebControls.DataGridCommandEventArg s)

Handles
>DataGrid1.UpdateCommand
>
>Cheers,
>siaj
>
>
>
>
>.
>

.

Nov 19 '05 #4
Thanks Elton..
It works..
siaj

"Elton Wang" wrote:
Hi siaj,

If the validation only affects Update, you might use
following logic:

In EditCommand event (after that, update and cancel will
be enabled)
disable validation
(you might also disable AddUser button here)
In UpdateCommand and CacellCommand (after that, it will
return normal state)
enable validation
(enable AddUser button)

HTH

Elton Wang
-----Original Message-----
U r right sir.. thanks..
I was having a validation on a different text box on the

same form(To add
user). This Text box gets visible only when user clicks

on button addUser.
What was happening was that when ever I was clicking

update on datagrid, post
back was happening and the validation was getting fired

for the empty
UserName text box( for adduser) which is hidden.
Now the scenario appears proper , and this is how It

should happen i.e
UserName textbox will be empty while I am updating a

value in the grid. How
should I take care that the validation for the AddUser

should get fired only
when I am trying to save new user not when postback is

happening due to some
other reason in the web form(for eg in the datagrid in

this case).

Will appreciate any idea..

cheers,
siaj

"Elton Wang" wrote:
Do you add any validator control in your page?

you may show us more detailed info, such as your HTML
datagrid code.

BTH, Since you have
Handles DataGrid1.UpdateCommand behind Sub
DataGrid1_UpdateCommand(ByVal source As System.Object,
ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs ), you don't need OnUpdateCommand="DataGrid1_UpdateCommand"
in HTML code. That may trigger the event twice.

Elton Wang
el********@hotmail.com
>-----Original Message-----
>Hello All,
>If some one has faced a similar issue..
>My datagrid Update command is not getting fired in fact it seems that the no
>event fires on clicking the update link. Although the
cancel and the Edit
>Commmand are getting fired properly.
>
>The One difference I have seen is that in the task
bar ..on hovering on the
>link the javascript for the update link seems different. I dont know if it
>makes sense..
>
>Edit Button : javascript:__doPostBack('DataGrid1 $_ctl7 $_ctl3','')
>Cancel buton : javascript:__doPostBack('DataGrid1$_ctl7
$_ctl0','')
>Update button :
>javascript:{if%20(typeof(Page_ClientValidate)%20! =%
20'function'%20||%20%20Page_ClientValidate())%
20__doPostBack('DataGrid1$_ctl7$_ctl2','')}
>
>fyi..
>I have in the HTML datagrid code
OnUpdateCommand="DataGrid1_UpdateCommand"
>and in Code behind..
>Public Sub DataGrid1_UpdateCommand(ByVal source As
System.Object, ByVal e As
>System.Web.UI.WebControls.DataGridCommandEventArg s)
Handles
>DataGrid1.UpdateCommand
>
>Cheers,
>siaj
>
>
>
>
>.
>

.

Nov 19 '05 #5

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

Similar topics

0
by: NETDeveloper | last post by:
Hi, I almost have my nested datagrid working properly. I created a datagrid on a user control and dropped that onto another datagrid. At first, I noticed when I was stepping through the code,...
1
by: Gidi | last post by:
helo i have few questions about working with datagrid 1. after i got help from this forum i succeded to move between columns by preesing the enter key, now my questio is how can i decdied which...
0
by: Wayneb | last post by:
Hi I have a datagrid with autogenerates columns based upon a dataset I have constructed from the results of database query - pretty noddy stuff. When you click on Edit I remove the standard...
1
by: AA | last post by:
We want to edit, update data of DataGrid in Asp.Net with VB.Net.and are writing the following code for EditCommand and UpdateCommand Event is : DataGrid1_EditCommand
4
by: Rod | last post by:
I posted a message to this group yesterday asking how to pass parameters to a web form that is the source of an IFrame on a parent web form. I've gotten my answer, and it works. Thanks! Now I...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
1
by: MrMike | last post by:
Hi. My application has dozens of datagrids but for some reason an exception occurs when one of them is updated. When a user edits a datagrid row and then clicks 'Update' the following exception...
4
by: Reney | last post by:
I have a very weird problem in updating my datagrid. Please help me to solve it. The datagrid is tied to a dataset table with five columns. Three of them are primary key and the other two columns...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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:
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.