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

[Solved] Row click...can I omit certain colums?

3 Answers 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
DogEars
Top achievements
Rank 2
DogEars asked on 21 Feb 2008, 04:15 PM
I'm using the following code to perform a row click on the client side that opens a new RadWindow.

 function RowClick(sender, eventArgs) 
    {         
        var MasterTableView = eventArgs.get_tableView();         
        var cell = MasterTableView.getCellByColumnUniqueName(MasterTableView.get_dataItems()[eventArgs.get_itemIndexHierarchical()], "item");    
        var cell2 = MasterTableView.getCellByColumnUniqueName(MasterTableView.get_dataItems()[eventArgs.get_itemIndexHierarchical()], "OrdNumb"); 
        var cell3 = MasterTableView.getCellByColumnUniqueName(MasterTableView.get_dataItems()[eventArgs.get_itemIndexHierarchical()], "POS");  
        var cell4 = MasterTableView.getCellByColumnUniqueName(MasterTableView.get_dataItems()[eventArgs.get_itemIndexHierarchical()], "HdrBuyFromBP");           
         var oWnd = radopen("Details.aspx?item=" + cell.innerHTML + "&Order_No=" + cell2.innerHTML + "&POS=" + cell3.innerHTML + "&BP=" + cell4.innerHTML ); 
          
          oWnd.add_close(OnClientClose); 
        }   
           
          function OnClientClose(sender,args)  
            {  
               // GetRadWindow().BrowserWindow.location.reload(); 
            }  
 
    </script> 

There are 10 columns in my grid. Is it possible to remove the first two columns from the row click event? So it would only pick up the click on columns 3-10?

I put the rowclick event in for ease of use, but now they want to be able to copy some order numbers from the first two columns.

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 25 Feb 2008, 01:25 PM
Hello,

In order to cater for the scenario that you mentioned, you can assign "onclick" client side events for the cells in the control. Other than that, the row click event will be fired per row and can be canceled. However, keeping track of which column the user is over, would require pretty much the same overhead. Therefore, you can safely assign onclick events only for the cells, which comply with your custom logic.
I hope this suggestion helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
DogEars
Top achievements
Rank 2
answered on 25 Feb 2008, 01:29 PM
I see. Can I continue to use the javascript that I already have for retrieving the items from the RagGrid?

Would you be able to provide an example on how to implement a cell click only?

Thanks.
0
Yavor
Telerik team
answered on 28 Feb 2008, 08:04 AM
Hi,

Attached to this message, is a sample, which handles a functionality similar to the one that we discussed initially. I hope it helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
DogEars
Top achievements
Rank 2
Answers by
Yavor
Telerik team
DogEars
Top achievements
Rank 2
Share this question
or