Datagrid template columns

R

R Corona

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top