double click and datagrid

K

kgs

I have datagrid with in a usercontrol.
I have doubleclick event tied to each row to post back
with the id of the control.

Though i get a postback on double click of the datagrid
But double click event handler is not triggered.

here is the code snipped for item bound
public void OnItemBound(Object Sender,
DataGridItemEventArgs e)
{
ListItemType itemType = e.Item.ItemType;

if (itemType == ListItemType.AlternatingItem ||itemType
== ListItemType.SelectedItem ||itemType ==
ListItemType.Item )
{

TableRow rw= e.Item;
if(dblClick!=null)
rw.Attributes["onclick"]="javascript:__doPostBack
('"+this.ClientID+"','"+Convert.ToString(e.Item.ItemIndex)
+"');";


any clues
thanks!!
 
K

kgs

this fixed it.
rw.Attributes["ondblclick"]
= "javascript:"+Page.GetPostBackEventReference
(this,Convert.ToString(e.Item.ItemIndex));
Thanks all
 

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,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top