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

Pass 2 parameters on double click

3 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Omlac
Top achievements
Rank 1
Omlac asked on 13 Oct 2008, 09:26 AM
I would like to pass two parameters(strLocation and strParent) on double click event. If its a single parameter its working fine but i cant pass more than one. Im registring the event on databound. Does anyone see whats wrong with my code below:
C#: RadGrid2_ItemDataBound
item.Attributes.Add("OnDblClick", "return LocationOpenWindow('" + strLocation+ ',' + strParent + "');");

JavaScript:
function LocationOpenWindow(strLocation,strParent){
var value = document.getElementById('<%=tboSiteID.ClientID%>').value;
window.open("frmLocation.aspx?ID=" + strLocation + "&SiteID=" + value + "&IDS=" + strParent ,"", "location=0,status=0,scrollbars=0,width=545,height=450");}

On Calling the parameters
lngLocationID = Convert.ToInt64(Request.QueryString["ID"]);
lngSiteID =
Convert.ToInt64(Request.QueryString["SiteID"]);
ParentID =
Convert.ToInt64(Request.QueryString["IDS"]);
error mesage is in correct format on the first line.

i dont think the javascript is wrong since i have tested it with constant values. The error is on Adding the double click event, where there is more than one argument.

Thank you.
 

3 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 13 Oct 2008, 11:49 AM
Hello Omlac,

You need to separate your arguments with literals if they are strings. Currently you have only one big argument.

This code:
'" + strLocation+ ',' + strParent + "'

should be:

'" + strLocation+ '','' + strParent + "'

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Omlac
Top achievements
Rank 1
answered on 13 Oct 2008, 12:02 PM
I fanally got it working

item.Attributes.Add(

"OnDblClick", "return LocationOpenWindow('" + strSelectedtxt + "','" + strParent + "');");

Thank you.

 

0
Omlac
Top achievements
Rank 1
answered on 13 Oct 2008, 12:27 PM
+ '','' + this part didnt work for me but this did: + "','" +

Thank you Vlad
Tags
Grid
Asked by
Omlac
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Omlac
Top achievements
Rank 1
Share this question
or