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

Grid row dblClick event

3 Answers 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wicus
Top achievements
Rank 1
Wicus asked on 26 Aug 2008, 09:39 AM
Hi can i plz get assistance...im using a radgrid to populate data from my database. i want to be able to double click on a certain row in the grid and open a new window whilst sending the id of that selected item through to the new window...is this possible?

3 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 26 Aug 2008, 10:13 AM
Hi Wicus,

You can execute window.open with desired url using OnRowDblClick client-side event. Here is an example how to define and get client-side data key names/values:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Client/Keys/DefaultCS.aspx

All the best,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Accepted
Princy
Top achievements
Rank 2
answered on 26 Aug 2008, 10:19 AM
Hello Wicus,

You can try out the following code to achieve the required scenario.
cs:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridDataItem) 
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            string strindx = item.ItemIndex.ToString(); 
            item.Attributes.Add("OnDblClick", "return OpenWindow('" + strindx + "');"); 
        } 
    } 

js:
 <script type="text/javascript" language="javascript" > 
        function OpenWindow(strindx) 
        { 
         alert(strindx) 
         window.radopen("RowID=" + strindx, "RadWindow1"); 
        } 
 </script> 

Thanks
Princy.
0
Wicus
Top achievements
Rank 1
answered on 26 Aug 2008, 10:29 AM
Hi Vlad and Princy...thnx alot for the replies...im sorted...great answers thnx...very helpful :)
Tags
Grid
Asked by
Wicus
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Princy
Top achievements
Rank 2
Wicus
Top achievements
Rank 1
Share this question
or