Required field validator is not activated in datagrid

S

Santosh

Dear all

i am using datagrid control with in my web page i am adding required
field validator in datagrid i want to activate it only when save
button is pressed for that i am initially set requiredfield validator
enable to false . but on button click event i am changing enable false
to
enable true but still it is not acivated . i am writting following code
for that can any one tell me what is problem with in it.

public void SaveRecords(DataGridItem item, int rowIndex)
{
RequiredFieldValidator logInId_Requiredfieldvalidator =
(RequiredFieldValidator)
item.FindControl("logInId_Requiredfieldvalidator");
RequiredFieldValidator userName_Requiredfieldvalidator =
(RequiredFieldValidator)item.FindControl("userName_Requiredfieldvalidator");

logInId_Requiredfieldvalidator.Enabled = true;
userName_Requiredfieldvalidator.Enabled= true;


}


Regards ,
Santosh
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top