Solved

GRIDVIEW ROW EDIT POP UP CALENDER

Posted on 2011-02-15
8
1,257 Views
Last Modified: 2012-06-27
I placed a gridview date changer in the template field for the Date selection as per below.   The calender graphic shows and I can select the date; however, it does populate the textbox.   Any assistance would be appreciated
withe the proper placement of the code.
<asp:templatefield HeaderText="Date" SortExpression="Dates">
	<EditItemTemplate>
	<asp:TextBox runat="server" Text='<%# Bind("Dates", "{0:MM/dd/yyyy}") %>' id="TextBox2">
	</asp:TextBox>

	<a href="javascript:;" onclick="window.open('popup.aspx? Textbox=TextBox2','cal','width=250,height=225,left=270,top=180')">
	<img src="SmallCalendar.gif" border="0" width="16" height="16"></img></a>
			
	</EditItemTemplate>
	<ItemTemplate>
	<asp:Label runat="server" Text='<%# Bind("Dates", "{0:MM/dd/yyyy}") %>' id="Label8">
	</asp:Label>
						
	</ItemTemplate>
	<HeaderStyle HorizontalAlign="Center" Wrap="False" Width="55px" />
	<ItemStyle HorizontalAlign="Center" Wrap="False" Width="55px" />
			</asp:templatefield>

Open in new window

0
Comment
Question by:BOEING39
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 20

Expert Comment

by:informaniac
ID: 34903973
Whn u place controls inside gridview it's clientid would change. So the datepicker is nt able 2 get d id of textbox.
0
 
LVL 20

Expert Comment

by:informaniac
ID: 34903981
So in RowDatabound event of gridview u need 2 assign the proper textbox client id to the datepicker.
0
 

Author Comment

by:BOEING39
ID: 34904036
Ok that makes sense.  Can you provide me an example?
0
 
LVL 11

Expert Comment

by:SAMIR BHOGAYTA
ID: 34904134
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

Expert Comment

by:informaniac
ID: 34904309

<a href="javascript:;" id="a1" runat="server" >
	<img src="SmallCalendar.gif" border="0" width="16" height="16"></img></a>

Textbox txt = e.Row.FindControl("t") as Textbox;
HtmlGenericControl a = e.row.FindControl("a1") as HtmlGenericControl;
a.Attributes.add(window...

Open in new window

0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34906079
0
 

Author Comment

by:BOEING39
ID: 34913000
Yes the data is a pop up calender control
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34914466
Did you try the code from link?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

939 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now