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

GetDataKeyValue("id") return null

2 Answers 58 Views
Grid
This is a migrated thread and some comments may be shown as answers.
morteza
Top achievements
Rank 1
morteza asked on 21 Aug 2010, 10:54 PM

I Copied mailbox (linked below) and it is work good. but when i changed XmlDataSource to my SqlDataSource (i fixed all data bound corectly) all GetDataKeyValue retunrn null.

 

<script type="text/javascript">

 

function ShowMessage(sender, args)

    {

 

        var id = args.getDataKeyValue("ID");//<==??????????????????????

 

        var wnd = window.radopen("Details.aspx?AuthorID=" + id, null);

 

        / /Get the clicked row

 

        var index = args.get_itemIndexHierarchical();

 

        var item = args.get_tableView().get_dataItems()[index];

 

        var rowElement = item.get_element();

 

        //Get coordinates of the row and reposition the window relative to it

 

        var bounds = $telerik.getBounds(rowElement);

        wnd.moveTo(bounds.x + 120 + index * 10, bounds.y - 180);

    }

 

</script>

 

 

Link:  http://demos.telerik.com/aspnet-ajax/window/examples/demoemail/defaultcs.aspx

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 23 Aug 2010, 11:15 AM
Hello Morteza,

Have you set ClientDataKeyNames. It is required to have this property of GridTableView set in order to retrieve data key values on client.

All the best,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
morteza
Top achievements
Rank 1
answered on 24 Aug 2010, 11:04 AM
Thanks admin very much.
its done. I expected this do automaticaly ,before.

Good Luck.
Best regards. Morteza
Tags
Grid
Asked by
morteza
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
morteza
Top achievements
Rank 1
Share this question
or