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

selecting a row by code does not fire SelectedIndexChanged

3 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hubert
Top achievements
Rank 1
Hubert asked on 05 Sep 2012, 03:14 PM
Hello telerik team,

selecting a row by code (JavaScript or code behind) does not fire the event SelectedIndexChanged.
The event is fired by clicking the row with the mouse, but not by code.

Example:
var mt = findGrid().get_masterTableView();
if(mt) {
  mt.clearSelectedItems();
  mt.selectItem(mt.get_dataItems()[1].get_element());
}

The item is selected but the event isn't fired.
EnablePostBackOnRowClick is enabled.

Greetings
Hubert

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 07 Sep 2012, 01:30 PM
Hi Hubert,

Could you please try the following approach and let me know about the result?
mt.get_dataItems()[1].get_element().click();

That should do the trick.

Regards,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
John
Top achievements
Rank 1
answered on 10 Sep 2012, 01:26 PM
I was looking for a similar approach to cause the "SelectedIndexChanged" server-side event to fire from the client.  In my case, this solution does not work for Safari 5.1.  Is there another way to cause the "SelectedIndexChanged" event to fire from the client side?
0
John
Top achievements
Rank 1
answered on 10 Sep 2012, 02:10 PM
Solution Found.
The solution I found was to use "fireCommand".  http://www.telerik.com/help/aspnet-ajax/grid-gridtableview-firecommand.html
John
Tags
Grid
Asked by
Hubert
Top achievements
Rank 1
Answers by
Eyup
Telerik team
John
Top achievements
Rank 1
Share this question
or