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

CausesValidation of editcommandcolumn

I have an editcommandcolumn in my datagrid, as follows.
<asp:editcommandcolumn ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" EditText="Edit">

I'd like to set the CausesValidation property of the Update portion to
false. Can't seem to get it to work. The Edit and Cancel linkbuttons have
CausesValidation turned off by default.

That cell in that row of my datagrid is being rendered in my trace, as
follows
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton

When I click Edit, two linkbuttons are rendered:
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton
dgCAReminders:_ctl3:_ctl5 System.Web.UI.LiteralControl
dgCAReminders:_ctl3:_ctl2 System.Web.UI.WebControls.DataGridLinkButton

I tried doing something in the OnItemCreated of the datagrid: (The
editcommandcolumn is in cell 1)
((LinkButton)e.Item.Cells[1].Controls[0]).CausesValidation = false;

But after looking at the trace, I realized that it doesn't make sense coz
the update linkbutton hasn't been rendered.

So I moved the above code to the OnEditCommand event, but I got the same
result.

What am I missing?
Nov 18 '05 #1
1 1673
if (e.Item.ItemType == ListItemType.EditItem)

{

((LinkButton) e.Item.Cells[1].Controls[0]).CausesValidation = false;

}

I forgot to check within the EditItem

"George Durzi" <gd****@hotmail.com> wrote in message
news:el**************@tk2msftngp13.phx.gbl...
I have an editcommandcolumn in my datagrid, as follows.
<asp:editcommandcolumn ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" EditText="Edit">

I'd like to set the CausesValidation property of the Update portion to
false. Can't seem to get it to work. The Edit and Cancel linkbuttons have
CausesValidation turned off by default.

That cell in that row of my datagrid is being rendered in my trace, as
follows
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton

When I click Edit, two linkbuttons are rendered:
dgCAReminders:_ctl3:_ctl1 System.Web.UI.WebControls.DataGridLinkButton
dgCAReminders:_ctl3:_ctl5 System.Web.UI.LiteralControl
dgCAReminders:_ctl3:_ctl2 System.Web.UI.WebControls.DataGridLinkButton

I tried doing something in the OnItemCreated of the datagrid: (The
editcommandcolumn is in cell 1)
((LinkButton)e.Item.Cells[1].Controls[0]).CausesValidation = false;

But after looking at the trace, I realized that it doesn't make sense coz
the update linkbutton hasn't been rendered.

So I moved the above code to the OnEditCommand event, but I got the same
result.

What am I missing?

Nov 18 '05 #2

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

Similar topics

18
by: Stanley J Mroczek | last post by:
I Set the EditCommandColumn to Visible=False to stop people who are not allowed to make any changes to a record. How can set it to Visible=true for some users? Please answer in VB Thanks Stan
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
1
by: angus | last post by:
Dear All, I am using VB.net It is found that the <asp:EditCommandColumn/> wouldn't fired an event for OnEditCommand If pushbutton has been used: that is:
0
by: tshad | last post by:
I have a table which works fine using the following templates: ********************************************************************************** <asp:TemplateColumn HeaderText="Answer">...
1
by: sakieboy | last post by:
Having an issue with the datagrid.... Instead of actually updating everytime someone selects update in the datagrid, I am currently writing an XML file on the server that consists of the datagrid...
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
4
by: Sourav Dutta Gupta | last post by:
I want to change the "scr" like src='images/Edit.ICO' to src='images/XYZ.ICO' dynamically based on some condition. My EditCommandColumn: <asp:EditCommandColumn ButtonType="LinkButton"...
0
by: slemen | last post by:
Hi, The DataGrid aps:EditCommandColumn when used with column templates created programmatically does not trigger the _Edit subroutine in code. The ASP:Datagrid definition is below (1), the...
0
by: slemen | last post by:
Hi, The asp:EditCommandColumn template does not fire the _edit sutboutine when the edit command column buttons are clicked. I get a Page Cannot Be Displayed page error instead. My (ASP 1.1)...
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: 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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.