[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Need help with jQuery with asp.net

Posted on 2015-01-05
4
Medium Priority
?
165 Views
Last Modified: 2015-01-06
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
Comment
Question by:lapucca
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 22

Expert Comment

by:Mrunal
ID: 40533067
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
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 2000 total points
ID: 40533528
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
 

Author Closing Comment

by:lapucca
ID: 40533976
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
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 40534340
Superb!

Glad it worked for you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a pageā€¦
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question