onTextChanged not firing

K

kbrandl

On my page, there is a textbox at the top that contains a date -- and a
fully-editable datagrid below (each row in the datagrid contains an
editable textbox, along with some other controls).

The date textbox is defined as:

<asp:TextBox EnableViewState="True" ID="HoursWorkedDate_TextBox"
Runat="server" width="80px" CssClass="inputstyle"
onBlur='javascript:Search.submit();' OnTextChanged="Date_Changed" />

When the date is changed, and the textbox loses focus (onBlur), the
page is submitted, causing the OnTextChanged event to fire and the
server-side "Date_Changed" method to execute. This is working
correctly.

Each textbox within the fully-editable datagrid is defined as follows:

<asp:TextBox Width="40px" CssClass="inputstyle" MaxLength="4"
ID="HoursWorked_TextBox" Runat="server" Value='<%#
DataBinder.Eval(Container.DataItem, "UpdateHoursWorked")%>'
OnTextChanged="DG_RowChanged" />

I would expect that if I change data within the textboxes of the
editable datagrid, and the page is submitted, the OnTextChanged event
would fire for any changed rows. This works fine if I submit the page
by clicking the submit button...but not if the page submits by the Date
textbox at the top of the page being changed.

If I change the data within the data grid, then change the date at the
top of the page and hit ENTER, the page refreshes -- but only the
OnTextChanged event associated with the Date textbox fires...the
OnTextChanged events associated with the datagrid textboxes do NOT
fire. What am I doing wrong here???
 
K

kbrandl

I've already tried that...when I set AutoPostBack=True for the 'Date'
textbox at the top, the form correctly posts when the text is
changed...but still the OnTextChanged events don't fire for any of the
modified textboxes within the datagrid below. Although setting
AutoPostback=True for the textboxes within the datagrid does work --
there's a big issue with this -- it prevents the user from simply
tabbing though the input textboxes in the grid -- since when they enter
text and tab, the page submits, causing the page to receive focus
again, instead of the next input element. Any other ideas?
 

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

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top