Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > CausesValidation of editcommandcolumn

Reply
Thread Tools

CausesValidation of editcommandcolumn

 
 
George Durzi
Guest
Posts: n/a
 
      02-12-2004
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?


 
Reply With Quote
 
 
 
 
George Durzi
Guest
Posts: n/a
 
      02-12-2004
if (e.Item.ItemType == ListItemType.EditItem)

{

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

}

I forgot to check within the EditItem

"George Durzi" <> wrote in message
news:elQtz$...
> 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?
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shouldn't server validation always occur when CausesValidation is true?? dustbort ASP .Net 2 02-28-2006 07:45 PM
validate method and causesvalidation Martin ASP .Net 3 05-21-2005 04:55 PM
advanced question: making <asp:ButtonColumn> CausesValidation=False z. f. ASP .Net 4 06-25-2004 07:51 PM
why <asp:ButtonColumn> for datagrid doesn't have CausesValidation property like <asp:Button> z. f. ASP .Net 4 06-23-2004 07:26 AM
CausesValidation not taking in Repeater control Josh Anderson - remove Zs to reply ASP .Net 0 11-20-2003 11:37 PM



Advertisments