OnTextChanged not firing??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a datagrid containing a number of item templates, inside of these
item templates I have various controls like the textbox. The user is able to
edit all the fields on the datagrid at once and then click an update button.
I'm trying to use the OnTextChanged event to capture which rows where updated
before I update the DB. I have added the line OnTextChanged="RowChanged" to
my text box control in the HTML and added the event handler called RowChanged
to the code behind. Is there something else I need to do to make this event
work?

My understanding is that this event does not get called until the page is
posted back, so I'm hoping that when I click the update button this event
will fire for all rows that have changed and then the update event will fire,
is this correct? I'm following the example
http://msdn.microsoft.com/library/d...QuestionsAboutASPNETDataGridServerControl.asp

Thanks
N
 
Hi,

I've fixed this now, it seems that I must rebind the datagrid for this event
to fire. Not sure why but it works...
 
Hi Neil:

During binding the grid will create the textbox control. If the code
doesn't re-bind the datagrid, the grid doesn't create the textbox, and
if there is no textbox there is no object to 'fire' an event.

Hope that clarifies a bit,
 

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

Back
Top