Findcontrol gridview row template field

WingYip
WingYip used Ask the Experts™
on
Hi
I have a gridview wich is loaded via a linqdatasource.

There is one column in the gridview that is a date and has been made into a template field ( i put a caleander extender on it).  Am having problems formatting the date text box.

How do I use findcontrol to find this textbox in for exampel teh rowdatabound event - is there another way of doing this.

Wing
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
if you put this into your row databound event

//Check row state of gridview whether it is data row or not
if (e.Row.RowType == DataControlRowType.DataRow)
        {
    TextBox MyTextBox= (TextBox )(e.Row.FindControl("MyTextBox"));
   
    MyTextBox.Text = "MyValue"; // or what ever you need to do with it
        {

Author

Commented:
tHANKS

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial