gridview template controls and validators

  • Thread starter Thread starter WebBuilder451
  • Start date Start date
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
 
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;

}
 
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
 
Back
Top