Validation with DetailView

B

bmayer

I have a form that has two gridviews for displaying data, two details
view are associated with the gridviews. The details views are used for
inserting individual records, which are then displayed by the
gridviews. The records are inserted by using the auto generated insert
buttons in the details view. There are also several text boxes that
need to be saved off to the DB when a button is pressed. There are
several validates contained in the detailsviews. I want them to
validate only inside of their respective detailsviews, not the entire
page.
From my understanding of how validate groups work, you can set the
validatorgroup property of a button to be the same as those of the
validates and then you can have several different groups which will be
independent of each other.

The problem that I am having is that I can not find the ValidationGroup
property for the insert link in the detailsview. This means that I have
to have values filled in both detailsviews to be able to submit one of
them.

Do I need to generate the buttons myself and then set the
validationgroup property?
 
K

Kyle K.

Try this...

- In Design mode, open the DetailsView Tasks window by clicking the
little arrow at the top-right of the control and click the 'Edit
fields...' link.
- In the dialog the opens up, select the 'CommandField' entry in the
'Selected fields:' box in the bottom-left.
- In the 'CommandField Properties:' box on the right, assign
CausesValidation = 'true' and ValidationGroup = '(group you defined)'.

This should have the effect you are looking for.

-={ Kyle }=-
 
B

bmayer

Perfect! Thank you.

Try this...

- In Design mode, open the DetailsView Tasks window by clicking the
little arrow at the top-right of the control and click the 'Edit
fields...' link.
- In the dialog the opens up, select the 'CommandField' entry in the
'Selected fields:' box in the bottom-left.
- In the 'CommandField Properties:' box on the right, assign
CausesValidation = 'true' and ValidationGroup = '(group you defined)'.

This should have the effect you are looking for.

-={ Kyle }=-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top