Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Calendar in Datagrid

Reply
Thread Tools

Calendar in Datagrid

 
 
John Walker
Guest
Posts: n/a
 
      07-20-2005
Hi,
I had posted the below question and received a suggestion from Fiaz, and
then I posted a followup question but received no answer. This was a while
ago so I thought that I should repost this. I hope Fiaz reads this, but if
not, does anybody else agree with Fiaz's suggestion? Oldest messages start
at bottom.

Thanks!
John

>>>>>>>>>>>> Original Messages >>>>>>>>>>>>>


Fiaz,

I applied your code but the offsets weren't what I had expected. The
hyperlink on every row in the datagrid showed the the same values. The
values were:
offsetTop: 1
offsetLeft: 77
offsetWidth: 31

The calendar would appear in the upper left hand area of the screen, even
though I was clicking on a hyperlink in the lower right hand side of the
browser. I applied your code exactly as you posted it. Might you have any
idea what I'm doing wrong?

Thanks again,
John

"Fiaz Ali Saleemi" wrote:

> Hi John
>
> Try this code sample and let us know. I hope it will work
>
> hlScheduledDeliveryCal = CType(e.Item.FindControl("hlScheduledDeliveryCal") ,
> HyperLink)
>
> hlScheduledDeliveryCal.Attributes.Add("onclick", "Go(this.offsetTop,
> this.offsetLeft + this.offsetWidth, '" &
> RTrim(txtScheduledDelivery.UniqueID) & "');")
>
> Add a javascript function to the client side.
>
> function Go(top, left, UniqueID)
> {
> var calendar_window = window.open('../controls/calendar.aspx?formname=' +
> UniqueID,
> 'calendar_window', 'width=154,height=184,top=' + top + ',left=' + left);
> calendar_window.focus();
> }
>
> Regards
> Fiaz Ali Saleemi
>
>
>"John Walker" wrote:
>
>Hi,
>In my datagrid I have a textbox with a hyperlink next to it. When the user
>clicks on the hyperlink it will pop open another window with a calendar
>control, and when the user clicks a date, it will put that date in the
>aforementioned textbox and close the calendar window. Here's the javascript
>which is added to the hyperlink during ItemDataBound:
>
>'-----> BEGIN (txtScheduledDelivery is the textbox control which gets
>populated with the date)
>
>hlScheduledDeliveryCal = CType(e.Item.FindControl("hlScheduledDeliveryCal") ,
>HyperLink)
>
>hlScheduledDeliveryCal.NavigateUrl =
>"javascript:calendar_window=window.open('../controls/calendar.aspx?formname="
>& RTrim(txtScheduledDelivery.UniqueID) &
>"','calendar_window','width=154,height=184,top=22 0,left=500');calendar_window.focus()"
>
>'-----> END
>
>The issue is, our customer wants the popup calendar window to always pop up
>right next to the hyperlink, so that the lazy users won't have to move the
>mouse too far. Has anyone else needed to control the nearly exact position
>of a popup window? Can it be easily done?
>
>Thanks,
>John
>
>
>

 
Reply With Quote
 
 
 
 
Fiaz Ali Saleemi
Guest
Posts: n/a
 
      07-21-2005
Hi John

Sorry for late response. Try this code sample and let us know. I am
confident it will work

hlScheduledDeliveryCal = CType(e.Item.FindControl("hlScheduledDeliveryCal") ,
HyperLink)

hlScheduledDeliveryCal.Attributes.Add("onclick", "Go(event.x, event.y, '" &
RTrim(txtScheduledDelivery.UniqueID) & "');")

Add a javascript function to the client side.

function Go(top, left, UniqueID)
{
var calendar_window = window.open('../controls/calendar.aspx?formname='
+ UniqueID,
'calendar_window', 'width=154,height=184,top=' + top + ',left=' + left);

calendar_window.focus();
}

You can set the left and top properties by passing event.x + number, event.y
+ number in Go method.
If it works let me know.

Regards
Fiaz Ali Saleemi


 
Reply With Quote
 
 
 
 
John Walker
Guest
Posts: n/a
 
      07-21-2005
Fiaz,

I needed to switch the x and y, but after that it worked like a charm.
Thanks so much for your help!

John

"Fiaz Ali Saleemi" wrote:

> Hi John
>
> Sorry for late response. Try this code sample and let us know. I am
> confident it will work
>
> hlScheduledDeliveryCal = CType(e.Item.FindControl("hlScheduledDeliveryCal") ,
> HyperLink)
>
> hlScheduledDeliveryCal.Attributes.Add("onclick", "Go(event.x, event.y, '" &
> RTrim(txtScheduledDelivery.UniqueID) & "');")
>
> Add a javascript function to the client side.
>
> function Go(top, left, UniqueID)
> {
> var calendar_window = window.open('../controls/calendar.aspx?formname='
> + UniqueID,
> 'calendar_window', 'width=154,height=184,top=' + top + ',left=' + left);
>
> calendar_window.focus();
> }
>
> You can set the left and top properties by passing event.x + number, event.y
> + number in Go method.
> If it works let me know.
>
> Regards
> Fiaz Ali Saleemi
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calendar GadGets does not show calendar iccsi Windows 64bit 4 08-14-2011 01:52 PM
How to Synchronise Hotmail Calendar with Standard Outlook Calendar using Outlook Connector ?? Synapse Syndrome Computer Support 0 12-02-2007 04:19 AM
Thunderbird Calendar with Exchange 2003 Calendar and Public FoldersCalendar jincmcse Firefox 1 09-03-2005 02:46 AM
Calendar Control - Programatically set the calendar to a date range Shevek ASP .Net 3 06-23-2004 01:41 PM
Calendar Control - Programatically set the calendar to a date range Shevek ASP .Net Web Controls 0 06-23-2004 12:06 PM



Advertisments