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

[Solved] Cannot select row

4 Answers 201 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Humayon
Top achievements
Rank 1
Humayon asked on 15 Apr 2009, 07:26 AM
Hi,
I got a serious problem with Radgrid. I am using Q1 2009.
There is a grid in my page. When this page loaded the first time, there are 20 rows data bound.
then user manually delete those rows from the client side using javascript. after that, user do a search,
we rebind the result to the grid using Ajaxpanel. problem comes from this point.
user cannot select another row using mouse click. but everything become normal again after first click.
in other words, the first mouse click is unhandled or trigger something weired. any mouse click after that is OK.
It is a strange behavior in Q1 2009, never happened before in 2008 build.
Thanks
--Humayon

4 Answers, 1 is accepted

Sort by
0
Humayon
Top achievements
Rank 1
answered on 15 Apr 2009, 07:51 AM
further to my post, I tried the demo from Telerik. We got the same behavior,
following code is from the demo, I added one line of code

   sender.get_masterTableView().get_dataItems()[0].set_selected(true);

this line of code is to select the first row in the grid once the grid is created

function GridCreated(sender, eventArgs)

{

    var grid = $find("<%=RadGrid1.ClientID %>");

   //you can also use the sender argument keyword to reference the client grid object

   log("ClientID of server-side grid object is: " + grid.get_element().id);

   sender.get_masterTableView().get_dataItems()[0].set_selected(true); //added by me, to recreate the behaviour

}


Now please try to select the current selected row, once it is unselected, you will never be able to select it again unless you click another row and come back.

further, I modified the code I added, I used
setTimeout("sender.get_masterTableView().get_dataItems()[0].set_selected(true);",100);
everything is fine.

I hope Telerik can come up hotfix for this ASAP, it is really important for us.
The demo I used for experiment is
http://localhost:8301/radcontrols_aspnetajax/grid/examples/client/clientsideevents/defaultcs.aspx
0
Yavor
Telerik team
answered on 21 Apr 2009, 05:48 AM
Hello Humayon ,

Thank you for your report. Can you please include some additional information on the setup. What are the steps to recreate the same behavior in the online demo? How do you UnSelect the current row - by Js, or by selecting another row? Any additional information on your setup will help me better address the issue at hand.

Regards,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Humayon
Top achievements
Rank 1
answered on 21 Apr 2009, 09:33 AM

Hi Yavor,
   sender.get_masterTableView().get_dataItems()[0].set_selected(true); 
is the only line of code(js) I added in the function GridCreated(sender, eventArgs) as in my previous post


in another word, I added one line of code (js) to select the first row once the grid is created,
then I used mouse to click the first row, it became unselected, and then I use mouse to click the same row again, nothing happened.
you cannot select the first row using mouse anymore, if you click another row using mouse, say the second row and go back to click the first row using mouse, everything become normal again.

if I change the js code to
setTimeout("sender.get_masterTableView().get_dataItems()[0].set_selected(true);",100);

above weird behaviour is gone.
Thanks
--Humayon
0
Accepted
Yavor
Telerik team
answered on 24 Apr 2009, 07:54 AM
Hello Humayon ,

One possible option is to call the selection at a later stage.
For example, you can use the following code:

.Js
  function pageLoad()  
             {  
                $find("<%=RadGrid1.ClientID %>").get_masterTableView().get_dataItems()[0].set_selected(true); //added by me, to recreate the behaviour  
             } 

This will preserve the standard behavior of the control.
I hope this helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Humayon
Top achievements
Rank 1
Answers by
Humayon
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or