For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > May 2004 > Datagrid template columns









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Datagrid template columns
R Corona

2004-05-31, 7:39 pm

I am creating a datagrid that has four columns. I am creating the first, an
edit column and the last in the html of the page. The middle two are being
added in the code behind. One is a readonly bound column, the other is a
template column. The template column is built in the code-behind along with
the databinding for the column. When the row is in edit mode the template
column is a text box. All this, the building of the grid the databinding,
etc, works fine until I try to update.

The code can't seem to find the text box. I have tried the following:
TextBox txtDisplay = (TextBox)e.Item.FindControl("txtDisplayText");

Which I have used on other pages to get the value just fine. But on this
page since the template column is built completely in the code-behind it
seems to not see the control. I get an undefined object when I look at
txtDisplay.

Any ideas or suggestions would be greatly appreciated.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com