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

[Solved] Hierarchical Grid-Index of Detailsview

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Priyanka C
Top achievements
Rank 1
Priyanka C asked on 11 Nov 2009, 07:56 PM
Hi,

I am using a 2- level hierarchical

 

grid.

 

Requirement is "to open different radwindows with different unq_id on doubleclick of a row in Master table and detail table of a hierarchical grid."
I am using  Javascript for this purpose.
I am able to get master grid rowindex and its unq-id (unique cloumn value) but I am not able to do this for DetailsView.
I need this unq-id because using this unq_d I have to show recorsd in the radwindow to view.

Can you please help me......I am using old  " Telerik.Webcontrols namesapce."

<ClientEvents OnRowDblClick="RowDblClick" />

 

 

function RowDblClick(rowIndex)

 

{

 

var grid = window["<%= RadGrid1.ClientID %>"];

 

 

 

var row = grid.MasterTableView.Rows[rowIndex];   // Clicked row

 

 

 

var value = row.KeyValues['UNQ_ID'];

 

window.radopen(

 

"Segment1.aspx?UNQ_ID=" + value , "UserListDialog");

 

 

}

 

 

 

 

 

 

<radW:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Blue">

 

 

 

<Windows>

 

 

 

<radW:RadWindow ID="UserListDialog" runat="server" Title="Editing record" Height="400px"

 

 

 

Width="300px" Left="150px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true" />

 

 

 

</Windows>

 

 

 

</radW:RadWindowManager>

 

 

 

 

Thanks.
Priyanka

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 16 Nov 2009, 02:37 PM
Hi Priyanka,

Are using the latest version of the controls? You have indicated version 2009.3.1103, however, your code snippets indicate that you are using the classic version of the rad controls.

For the latest version of the controls, you can access the data item in the double click event as follows:

<script type="text/javascript">
      
    function rowDoubleClick(sender, args)
    {
        var clickedItem = args.get_tableView().get_dataItems()[args.get_id().split("_")[args.get_id().split("_").length - 1]];
    }   
  
</script>

I hope this helps.

All the best,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Priyanka C
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or