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

x
  • 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.
TemplateField-jQuery.html
0
lapucca
Asked:
lapucca
  • 2
1 Solution
 
MrunalCommented:
Hi,
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.
0
 
sammySeltzerCommented:
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.

http://forums.asp.net/t/1668230.aspx?JQuery+Datepicker+for+edit+item+template+textbox+in+gridview
0
 
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!
0
 
sammySeltzerCommented:
Superb!

Glad it worked for you.
0

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