Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've got a CalendarExtender attached to my Textbox in a TemplateField of a GridView. Things are mostly working, but I want the user to be able to bypass the CalendarExtender and manually enter a date in the Textbox (and more importantly, to clear the date, as it is a nullable DB field). I've been using the CalendarExtender's OnClientDateSelectionChanged event to do my data validation and trigger my postback so the cached data can be updated on the server. On a manual entry in the Textbox, however, that event doesn't fire, so my client-side edit gets lost. I've also found that I can't use the Textbox's onchange event to postback, as that somehow messes up the CalendarExtender's events (the result is that the DataBind fires the onchange again for each row).

I think I can instead use the CalendarExtender's OnClientHidden event, check whether the value in the Textbox is different from its default (original) value, and fire the validation and postback there instead. Seems like I'm bending over backward to get this fairly straightforward process done, however--anyone got a different tried and true method of updating a server-side dataset from a Textbox linked to a CalendarExtender?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900