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

Grid Client Events

8 Answers 268 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Limkemann
Top achievements
Rank 2
Brian Limkemann asked on 10 Dec 2007, 11:57 PM
I have just installed the most recent futures build (2007.3.1205) and I'm trying to consume the client-side RowSelected event. The event fires fine, but neither parameter contains the data shown in the help and online demo. Is this feature yet fully functional? If so, what am I missing? If not, when will it be complete?

8 Answers, 1 is accepted

Sort by
0
Petja
Telerik team
answered on 11 Dec 2007, 10:01 AM
Hello Brian Limkemann,

Find attached the futures help chm file for your reference. We have made all client-side events arguments to have the same arguments the way the asp.net ajax controls are due to performance reasons - the first argument is the sender object, the second are arguments, which you can access all necessary data from. If the events is a row event, you could access the data item by eventArgs.get_gridDataItem();, if it is a column event, the column object could be accessed by eventArgs.get_gridColumn());. Some of the client-side events are still not finished as well as their documentation but the arguments will be preserved to be the same.

Regards,
Petja
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brian Limkemann
Top achievements
Rank 2
answered on 11 Dec 2007, 12:57 PM
I was looking at that documentation previously. I am trying to handle the RowSelected event. I sent up my JS function to be: function gridRowSelected(sender, args) {
}

If I try to call args.get_gridDataItem() I get an error. So I try to call alert(args.get_GridDataItem) to view the method and the alert box displays "undefined". So am I to believe that although the documentation says that method exsits that it really is not implemented yet?
0
Petja
Telerik team
answered on 13 Dec 2007, 03:28 PM
Hi Brian Limkemann,

We see that you want to achieve the DataItem of the clicked row. Note, that the get_gridDataItem() is not directly available on the client unless OnRowCreating/OnRowCreated events are hooked up. This is done due to optimization performance reasons and will be written in the help of the next version of the product. There is other way you could access the data item: sender.get_masterTableView().get_dataItems()[args.get_itemIndexHierarchical()]
Note that the Prometheus RadGrid version client-side events follows the asp.net ajax way of accessing properties.
If you have some further problems, please, let us know what exactly you want to achieve so we could advice you further.

Best wishes,
Author nickname
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Brian Limkemann
Top achievements
Rank 2
answered on 13 Dec 2007, 05:46 PM
Thank you for the clarification. All I was trying to do was get the key value(s) of the selected row so I could pass them off to an iframe. Luckiliy, I discovered that I didn't need the data item since the eventArgs parameter allows access to the key values.

I do have a question, though. I was initially trying to use the masterTableView to get the selected item(s). This always returned null. Will this only be non-null if the OnRowCreating / OnRowCreated are handled? If so, this really neess to be documented well.
0
Petja
Telerik team
answered on 17 Dec 2007, 11:17 AM
Hello Brian Limkemann,

In the Futures release of RadGrid control the selected items collection gives null value which seems to be a bug and our developers already fixed it, so you could access it normally using the next version of our Prometheus controls which is released tomorrow.

Sincerely yours,
Petja
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Nyceane
Top achievements
Rank 1
answered on 22 Dec 2007, 02:29 AM
nope, still not fixed, still giving null value.
0
Nyceane
Top achievements
Rank 1
answered on 26 Dec 2007, 10:54 PM
Petja,
any update on RadGrid.SelectedValue?  will it be fixed sometime within next month?

Peter
0
Petja
Telerik team
answered on 28 Dec 2007, 08:47 AM
Hi Nyceane,

You could access the selected items in the OnRowSelected client-side event handler by its table owner, i.e.:
sender.get_masterTableView().get_selectedItems()
We have logged the sender.get_selectedItems() issue in our bug system and our developers will review it as soon is possible. Thank you for your report. We have updated your Telerik points.

Happy holidays!

Greetings,
Petja
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Brian Limkemann
Top achievements
Rank 2
Answers by
Petja
Telerik team
Brian Limkemann
Top achievements
Rank 2
Nyceane
Top achievements
Rank 1
Share this question
or