This is a migrated thread and some comments may be shown as answers.

Double Click not Working/Inconsistent

2 Answers 27 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Omlac
Top achievements
Rank 1
Omlac asked on 03 Oct 2008, 02:04 PM
My radgrid doesnt  work fine on a double click. My problem is on many occasions the event for a double click is not triggered. It will respond after i have tried many times.
My code for c# and code behind is shown below:
C#
protected void rdgContacts_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in rdgContacts.MasterTableView.Items){
if (item.Selected){strSelectedtxt = item["UserID"].Text; }}}
protected void rdgContacts_ItemCommand(object source, GridCommandEventArgs e){
if (e.Item is GridDataItem){GridDataItem dataItem = (GridDataItem)e.Item; dataItem.Attributes.Add("OnDblClick", "return ContactOpenWindow('" + strSelectedtxt + "');");}


HTML Code/Java script

function ContactOpenWindow(strSelectedtxt){
window.open(
"frmSiteContacts.aspx?ID=" + strSelectedtxt,"", "location=0,status=0,scrollbars=0,width=600,height=430");}

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 06 Oct 2008, 04:00 AM
Hi,

Try adding the double click client event for the items in the ItemDataBound event as shown below.

CS:
 protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            string strSelectedtxt; 
            GridDataItem item = (GridDataItem)e.Item; 
            if (item.Selected) 
            { 
                strSelectedtxt = item["UserID"].Text.ToString(); 
            } 
            item .Attributes.Add("onDblClick", "return ContactOpenWindow('" + strSelectedtxt + "');"); 
        } 
    } 


Shinu
0
Omlac
Top achievements
Rank 1
answered on 06 Oct 2008, 07:15 AM
Thank you very much Shinu,
Its now working perfectly.

Thank you very much for your help.
Tags
Grid
Asked by
Omlac
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Omlac
Top achievements
Rank 1
Share this question
or