Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > cell double click

Reply
Thread Tools

cell double click

 
 
simon
Guest
Posts: n/a
 
      12-03-2003
which data control allows me to use a cell doubleClick event?

I have time cells (something like Outlook calendar) and when user double
click on one cell I would like to redirect to other window where he could
insert events for that time. Then he go back to that page and see event in
that cell.

How can I do that?

Thank you,
Simon


 
Reply With Quote
 
 
 
 
Joe Gass
Guest
Posts: n/a
 
      12-03-2003
The html would be something like

<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td
onDblClick="javascript:window.location='http://www.google.com'">Double Click
this cell</td>
</tr>
</table>

Now to get that in a data bound control...
Perhaps with
..attributtes.add("onDblClick","javascript:window. location='/yourInsertEventP
age.aspx'")

On the relevant cell, during itemcreated or itemdatabound



"simon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> which data control allows me to use a cell doubleClick event?
>
> I have time cells (something like Outlook calendar) and when user double
> click on one cell I would like to redirect to other window where he could
> insert events for that time. Then he go back to that page and see event in
> that cell.
>
> How can I do that?
>
> Thank you,
> Simon
>
>



 
Reply With Quote
 
 
 
 
simon
Guest
Posts: n/a
 
      12-03-2003
Thank you for your answer. Attributes.Add has only dataGrid( before I had
dataRepeater).
Now I would like that function test is executed when user doubleClicks on
the cell.
I must know which cell is, that I can insert events for that cell (time in
fact, because each cell represent the hour of a day) so I use
e.Item.itemIndex. But this code doesn't work.

Do you know why?

Private Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemCreated

DataGrid1.Attributes.Add("onDblClick", test(e.Item.ItemIndex))

End Sub

Function test(ByVal indeks)

label1.Text = indeks

End Function



Thank you,

Simon

"Joe Gass" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The html would be something like
>
> <table border="1" cellspacing="0" cellpadding="0">
> <tr>
> <td
> onDblClick="javascript:window.location='http://www.google.com'">Double

Click
> this cell</td>
> </tr>
> </table>
>
> Now to get that in a data bound control...
> Perhaps with
>

..attributtes.add("onDblClick","javascript:window. location='/yourInsertEventP
> age.aspx'")
>
> On the relevant cell, during itemcreated or itemdatabound
>
>
>
> "simon" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > which data control allows me to use a cell doubleClick event?
> >
> > I have time cells (something like Outlook calendar) and when user double
> > click on one cell I would like to redirect to other window where he

could
> > insert events for that time. Then he go back to that page and see event

in
> > that cell.
> >
> > How can I do that?
> >
> > Thank you,
> > Simon
> >
> >

>
>



 
Reply With Quote
 
simon
Guest
Posts: n/a
 
      12-04-2003
Hello,

I tried your example, it works ok, but I need to redirect to the page with
ID of clicked cell

If I try like this, I always get the ID of the last cell:

Private Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemCreated

If e.Item.ItemIndex <> -1 Then

Dim key As String = DataGrid1.DataKeys(e.Item.ItemIndex).ToString()

DataGrid1.Attributes.Add("onDblClick", "test('" & key & "')")

End If

End Sub

and on page:

<SCRIPT language="javascript">

function test(id)

{

window.location='http://www.redirectPage.aspx?id="+id

}

</SCRIPT>

Or with other words, How can I know which cell was double clicked?

Thank you,

Simon

"simon" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thank you for your answer. Attributes.Add has only dataGrid( before I had
> dataRepeater).
> Now I would like that function test is executed when user doubleClicks on
> the cell.
> I must know which cell is, that I can insert events for that cell (time in
> fact, because each cell represent the hour of a day) so I use
> e.Item.itemIndex. But this code doesn't work.
>
> Do you know why?
>
> Private Sub DataGrid1_ItemCreated(ByVal sender As Object, ByVal e As
> System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> DataGrid1.ItemCreated
>
> DataGrid1.Attributes.Add("onDblClick", test(e.Item.ItemIndex))
>
> End Sub
>
> Function test(ByVal indeks)
>
> label1.Text = indeks
>
> End Function
>
>
>
> Thank you,
>
> Simon
>
> "Joe Gass" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The html would be something like
> >
> > <table border="1" cellspacing="0" cellpadding="0">
> > <tr>
> > <td
> > onDblClick="javascript:window.location='http://www.google.com'">Double

> Click
> > this cell</td>
> > </tr>
> > </table>
> >
> > Now to get that in a data bound control...
> > Perhaps with
> >

>

..attributtes.add("onDblClick","javascript:window. location='/yourInsertEventP
> > age.aspx'")
> >
> > On the relevant cell, during itemcreated or itemdatabound
> >
> >
> >
> > "simon" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > which data control allows me to use a cell doubleClick event?
> > >
> > > I have time cells (something like Outlook calendar) and when user

double
> > > click on one cell I would like to redirect to other window where he

> could
> > > insert events for that time. Then he go back to that page and see

event
> in
> > > that cell.
> > >
> > > How can I do that?
> > >
> > > Thank you,
> > > Simon
> > >
> > >

> >
> >

>
>



 
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
how can i programmatically double click a table cell? andric Java 0 02-01-2008 09:23 AM
cannot convert parameter from 'double (double)' to 'double (__cdecl *)(double)' error Sydex C++ 12 02-17-2005 06:30 PM
Web: Capturing the current cell values on double-click event of a datagrid Tony Fields ASP .Net 0 12-09-2004 04:09 PM
Single click in scroll bar does double click Mark Cranness Computer Support 2 11-14-2003 06:03 PM
click - double click skip Computer Support 2 11-11-2003 05:29 PM



Advertisments