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

radgrid selecting row with keyboard

1 Answer 199 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matteo
Top achievements
Rank 1
Matteo asked on 12 Mar 2009, 03:36 PM
hi

i have a radgrig in dnn custom module.
i found this on guide to select and active a row in the same time

    <script type="text/javascript"
   function RowSelected(sender, args) 
   {    
       var grid = $find(sender.get_id()); 
       { 
           grid.set_activeRow($get(args.get_id())); 
           document.getElementById("<%= lblTest.ClientID %>").text ="<b>CODICE: </b>" + args.getDataKeyValue("CODICE_PRODOTTO"); 
                  
        //    __doPostBack("<%= RadGridGiro.UniqueID %>", "RowClicked:" + eventArgs.get_itemIndexHierarchical());      
       } 
   } 
   function ActiveRowChanged(sender, args) 
   { 
    
       if (sender.get_masterTableView().get_selectedItems().length < 1 || sender.get_masterTableView().get_selectedItems()[0].get_id() != args.get_id()) 
       { 
           args.get_tableView().selectItem($get(args.get_id()));          
       } 
   } 
      </script> 

and with this configuration
 <ClientSettings AllowKeyboardNavigation="True" EnablePostBackOnRowClick ="false"
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" /> 
                    <Selecting AllowRowSelect="True" /> 
                    <ClientEvents OnActiveRowChanged="ActiveRowChanged" OnRowSelected="RowSelected" /> 
                </ClientSettings> 
it work, putting the code i need in a label.

now i have to manage the code in label to obtain a "detail", but server side the event for selected index change wont fire.
reading around i see EnablePostBackOnRowClick ="true"
whit this event fire but i've got no keyboard support.
can yuo explain me where i'm wrong?
sorry for my bad english.
Thanks
Teo


1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 16 Mar 2009, 12:12 PM
Hello Matteo,

The SelectedIndexChanged event handler for the grid will be raised when you are using server side selection - for example a select button. The approach which you presently have in place is using a pure client side approach. One possibility in this case would be to make an AjaxRequest to the server, at any point through client side code. Additionally, you can set the value of the related control on the client, if posting to the server is not required.
I hope this helps.

Sincerely yours,
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
Matteo
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or