J
Jim Heavey
Suppose I am using a series of controls in the footer of a datagrid which
allows a user to enter "a new row of information to be added to the
datagrid datasource". Some of these controls have a "RequiredValidator"
control. I am able to enter data and all is well.
On this same datagrid I have a "EditCommand" column which get the user int
the Edit/Update/Cancel mode, allowing the user to edit individual lines.
When I enter the "Edit" mode and the user enters data and presses the
"Update" link, the edits on the footer are being triggered, and it is never
reaching the "update" or "Cancel" logic.
How can I get "requiredValidator" controls in the footer to not be active
when in the edit mode?
I thought I would add the controls in code in the "Item_Created" mode and
set a flag if I was in the "Edit" mode, and if I was in the edit mode, I
would simply not add the controls to the footer. But I have been less then
successfull in adding the controls in code to the footer. I am getting a
error about the control not being well formed "Control 'txtAddMovieTitle'
of type 'TextBox' must be placed inside a form tag with runat=server.". I
have a form tag and it has a runat="Server" and my datagrid tag as well has
a "runat="Server".
Any ideas about how to get around the problem?
allows a user to enter "a new row of information to be added to the
datagrid datasource". Some of these controls have a "RequiredValidator"
control. I am able to enter data and all is well.
On this same datagrid I have a "EditCommand" column which get the user int
the Edit/Update/Cancel mode, allowing the user to edit individual lines.
When I enter the "Edit" mode and the user enters data and presses the
"Update" link, the edits on the footer are being triggered, and it is never
reaching the "update" or "Cancel" logic.
How can I get "requiredValidator" controls in the footer to not be active
when in the edit mode?
I thought I would add the controls in code in the "Item_Created" mode and
set a flag if I was in the "Edit" mode, and if I was in the edit mode, I
would simply not add the controls to the footer. But I have been less then
successfull in adding the controls in code to the footer. I am getting a
error about the control not being well formed "Control 'txtAddMovieTitle'
of type 'TextBox' must be placed inside a form tag with runat=server.". I
have a form tag and it has a runat="Server" and my datagrid tag as well has
a "runat="Server".
Any ideas about how to get around the problem?