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

Deselecting Row Client side

2 Answers 49 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jan
Top achievements
Rank 1
jan asked on 24 Aug 2008, 10:16 PM
Hello,

I am using RadGrid for ASP.NET and I was faced following problem:

I am using my client side functions for selecting and deselesting rows in a radgrid. I found out that both can be done by caling SelectRow function (in multi select mode this select unselected row and deselect selected row), because function DeselectRow did not work for deselecting (row stayed selected).
 Then I tryed to automaticaly update second grid based on selections in a first grid with calling AjaxRequestWithTarget. This work well (after selecting row or deselecting row second grid is updated) until the very last row is deselected - then it appers deselected on a client but selected on a server side - is there any work around how to handle this?

Thank you
Jan Krivanek

2 Answers, 1 is accepted

Sort by
0
jan
Top achievements
Rank 1
answered on 24 Aug 2008, 10:43 PM

Or to specify a little bit:

I found out that there is a little workaround. This problem with deselecting all selected rows does not occure when second grid is updated in event handler of ittem command event and then this item command is fired. This can be done easy from server side ( RadGrid.Items[0].FireCommandEvent("Refresh", null); ), but can I simulate this somehow by calling ajax request from javascript client side?

Thank you
0
jan
Top achievements
Rank 1
answered on 25 Aug 2008, 06:14 AM
Finaly I have worked it around by using client side request for ajax callback -  AjaxRequestWithTarget (and properly registred target control with RegisterForEventValidation - as shown e.g here:
http://www.telerik.com/community/forums/thread/b311D-bdmcet.aspx
)

And than overiding RaisePostBackEvent handler in which I fire Item command event (
if (myGrid.Items.Count > 0)
{
    myGrid.Items[0].FireCommandEvent("Refresh", null);
}
)

This has completely solvewd my problem with selecting/deselecting rows with SelectRow function.
Tags
Grid
Asked by
jan
Top achievements
Rank 1
Answers by
jan
Top achievements
Rank 1
Share this question
or