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

[Solved] Hierarchical Grid Multi Select - Rtn Selected Rows

2 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marcus
Top achievements
Rank 1
Marcus asked on 04 Mar 2010, 09:42 AM
 function showPopupForm() {  
        var grid = $find("<%= RadGrid1.ClientID %>");  
        var masterTableView = grid.get_masterTableView();  
        var row = masterTableView.get_selectedItems()[0];  
        var dataKeyValue = masterTableView.get_selectedItems()[0].getDataKeyValue("ean");  
        window.radopen("EditFormCS.aspx?Ean=" + dataKeyValue, "UserListDialog");  
    }  

I hope someone can help with the above. The script runs in my app with no errors - but the dataKeyValue returns NULL

The below code works on the Server Side:-

For Each item As GridDataItem In RadGrid_detail.SelectedItems 
             
            Response.Write(item("ean").Text.ToString()) 
             
            Dim ID As String = item.GetDataKeyValue("ean") 
 
        Next 

I am trying to use the Client rather than the Server to return the multiple selected values as I wish to save on round trips to the server.

Do I need some sort of ClientEvents to activate the above Java??

Any help would be Fantastic!!!

PS I am working with a Hierarchical Grid.


2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 04 Mar 2010, 11:16 AM
Hello Marcus,

Have you set the ClientDataKeyNames of MasterTableView as "ean"'?

-Shinu.
0
Marcus
Top achievements
Rank 1
answered on 04 Mar 2010, 01:21 PM
Hi Shinu,

I have solved the issue by looking at the following:-

http://www.telerik.com/community/forums/aspnet-ajax/grid/get-selected-detailtable-client-side.aspx

This now works.

Thanx for your steer.

Marcus
Tags
Grid
Asked by
Marcus
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Marcus
Top achievements
Rank 1
Share this question
or