Calendar in Datagrid

J

John Walker

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

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
 
F

Fiaz Ali Saleemi

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
 
J

John Walker

Fiaz,

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

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top