hi
i use a gridview control with a template column which contains textbox as itemtemplate.

i'm trying to change the textbox's border color in runtime like this:

((TextBox)MyGrid.Rows[i].FindControl("txtEnter")).BorderColor = Color.Red;

but it doest change anything.

what am i duing wrong ?

Recommended Answers

All 2 Replies

use like this

TextBox txt  =(TextBox)Gridview.findcontrol("txt1");
txt.so and so....

let me know it is working?

hi,

where r u using this

((TextBox)MyGrid.Rows[i].FindControl("txtEnter")).BorderColor = Color.Red;((TextBox)MyGrid.Rows[i].FindControl("txtEnter")).BorderColor = Color.Red;

i mean which event.
can u show me u r code

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.