gridview template controls and validators

W

WebBuilder451

I have a gridview with templates and textboxes i'm putting i want to put the
validator in a template at the last cell. How can i get the validator to see
the textbox if i create it and move it it does not validate.

is there a work around?
--
(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)

kes
 
W

WebBuilder451

Well i'm on a roll today!
this is how i do it
in the gridview row databound event
if (e.Row.RowType == DataControlRowType.DataRow)
{

((RequiredFieldValidator)e.Row.FindControl("REquiredFieldFirstName")).ControlToValidate = ((TextBox)e.Row.FindControl("TextBoxFirstName")).ID;

}
 
W

WebBuilder451

found the answer my accident!!! but it works, albeit wordy.
--
(i''ll be asking a lot of these, but I find C# totally way cooler than vb
and there''s no go''n back!!!)
thanks (as always)

kes
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top