| 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.
|