Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

Need help with jQuery with asp.net

Hi, I'm using vs2012
I have a gridview where the last column is a datetime column and I also have changed this column from boundfield to a Templatefield.  I've attached the page source for this page.  After clicking the Edit button, the last column(datetime) is now a Input type=Text.  Other rows not in Edit mode the last column is just a <span> date.  

The jQuery I have right now is not working.  How can I pop up the datetimepicker when user clicks on that cell when it's in Edit mode as a textbox?  

Thank you.
  • 2
1 Solution
First thing to check that:
Is your jquery function, which is responsible for generating datepicker, is getting called after you click on edit button ?
If not, then you have to call it in edit mode so that it will bind datepicker plug in after that textbox is visible on browser.

Second thing, you have written selector for getting that datetime textbox, which will loop to other textboxes also which are only displaying names.
so update it like this:

$j('#MainContent_gridAccounts > input[id~="txtExpDate"]')

hope this helps you.
Right move by changing from BoundField to templateField as BoundField is used by data-bound controls to display value in a text.

See if this one helps solve your problem.

lapuccaAuthor Commented:
My grid is bind to a data source.  I've been stock on this for 2 weeks!  I can't thank you enough for the url you provided.  That is the only one that works!

Glad it worked for you.

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now