Hi
I didn't fully understand your question. Now I got it.
Client-side validation logic doesn't care, actually
doesn't know which button is clicked. To client-side it
either submit or not depending validated fields. So it's
difficult to control its workflow. In that case, you might
change it to server-side validation. On server-side, if
button in footer is clicked, you know you don't need worry
about textbox in edit field, so you only check text fields
in footer, vice versa. The disadvantage of server-side
validation is negative performance and there is no any pre-
built control. You have you're your own validation logic.
HTH
-----Original Message-----
I'm trying to understand your response, maybe I'm not
understanding it.This is a validation issue, meaning the form ca not be
submitted, etc.So even though I have e.CommandArgument = "Insert" (see
the tag in the firstpost below) it never reaches it becuase the validation
fails.The strange thing is when I add a record, the validation
is only for thatrow The footer). When I enter into edit on a row then try
to update that rowthe validation fires first for add only('insert')?
the edit column doesn't have any argumentsedit links: ><asp:EditCommandColumn ItemStyle-Width="75" ItemStyle-
CssClass="gridtext" >ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" >EditText="Edit">
></asp:EditCommandColumn>
"Elton Wang" wrote:
Hi Chris,
If the problem is about validation, you might disable
client-side validation and use server-side validation.
If the problem is two buttons share UpDate_Command
event, you can change CommandName of button in footer, i.e. to
Add, then handle datagrid_ItemCommand Event:
If e.CommandName = "Add" Then
' process
End
Actually, ItemCommand Occurs when any button is clicked
in the DataGrid control.
HTH,
Elton Wang
el********@hotmail.com
>-----Original Message-----
>Based upon some prevoius postings on what to do for
adding a 'add' row to a >datagrid I utilize the footer to create the 'add' row.
The only issue is that >I have it sharing the 'UpDate_Command' and I use an
argument to difference >between an 'edit' vs. and 'add. But since I have field
validation on both >'footer' and 'edit' columns I can't submit my edits
since the footer >validation kicks in.If I take the validation off then
the both work fine (an >insert or an update to record)
>
>Add link:
><FooterTemplate>
><asp:LinkButton id="btnAddRow" runat="server"
CssClass="gridqtext" >Text="<u>Add</u>" CommandName="Update"
CommandArgument="Insert"> ></asp:LinkButton>
></FooterTemplate>
>
>edit links:
><asp:EditCommandColumn ItemStyle-Width="75" ItemStyle-
CssClass="gridtext" >ButtonType="LinkButton" UpdateText="Update"
CancelText="Cancel" >EditText="Edit">
></asp:EditCommandColumn>
>
>they are both sharing the:
> Private Sub gdconcerndetail_UpdateCommand(ByVal
source As System.Object, >ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs )
Handles >gdconcerndetail.UpdateCommand
>
>Ideas? Thanx.
>.
>
.