Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Manipulating control templates

Status
Not open for further replies.

Peppi

Programmer
Apr 9, 2001
205
CA
Hi,

I have a more substantial question now.

In the ItemTemplate of my GridView control, I have two of the columns set to textboxes so that users can make changes to several rows at once. However, there are some cases where these textboxes should be labels so that they cannot be edited. Is it possible to change the controls in these cases from textboxes to labels? If worse comes to worse I can just disable the textbox but I'd rather change the control. I know that you can create control templates dynamically but it seems to me that they can only be applied on a per column basis and not on a per cell basis?

Thx.
 
Yes, you could hide the TextBox and dynamically add a Label control via the Controls.Add method of the relevant section.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top