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

[Solved] RowDoubleClick Action

1 Answer 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dany V
Top achievements
Rank 1
Dany V asked on 30 Jun 2009, 08:06 PM
Hi, I'm using a radgrid inside my application and I would like to open a new window when I double-clicked a row to show more info about that "item". 

 I'll appreciate your help in advance
Daniel

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Jul 2009, 04:15 AM
Hi Daniel,

Attach OnRowDblClick event to RadGrid so that you can open RadWindow within that handler and pass the clicked dataitem value as Url parameter.

ASPX:
 
<telerik:RadGrid ID="RadGrid1" AllowSorting="true" runat="server" DataSourceID="SqlDataSource2" GridLines="None"
    <MasterTableView DataSourceID="SqlDataSource2" TableLayout="Fixed" ClientDataKeyNames="OrderID" CommandItemDisplay="Top" AutoGenerateColumns="False" CellSpacing="-1"
        <Columns> 
         . . . 
        </Columns> 
    </MasterTableView> 
    <ClientSettings> 
        <ClientEvents OnRowCreated="OnRowCreated" OnRowDblClick="OnRowDblClick"  /> 
    </ClientSettings>     
</telerik:RadGrid> 

JavaScript:
 
<script type="text/javascript"
function OnRowDblClick(sender, eventArgs) 
    var OrderID = eventArgs.get_gridDataItem().getDataKeyValue("OrderID"); 
    var oWnd = radopen("MyDialog.aspx?OrderID=" + OrderID, "RadWindow1"); 
    oWnd.Center(); 
function OnRowCreated() 
 
</script> 

The parameters that you send can be read from the Request object in the Page_Load method of the RadWindow page.
C#:
 
protected void Page_Load(object sender, EventArgs e)   
{   
    if (Request["OrderID"] != null)   
    {   
        Response.Write(Request["OrderID"]); 
    }   
}  

Thanks,
Shinu.
Tags
Grid
Asked by
Dany V
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or