Code Review Stack Exchange is a question and answer site for peer programmer code reviews. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I do a single select in one radgrid, and based upon that selection I want to select multiple rows in a different radgrid:

<telerik:RadGrid ID="rgPaymentLines"> <ClientEvents OnRowSelected="RowPaymentSelected"/> ... </telerik:RadGrid>

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">

        function RowPaymentSelected(sender, eventArgs) {
            var grid = $find("<%=rgPaymentLines.ClientID %>");
            var MasterTablePayment = grid.get_masterTableView();
            var paymentRow = MasterTablePayment.get_selectedItems()[0];
            var paymentCell = MasterTablePayment.getCellByColumnUniqueName(paymentRow, "DossierID")
        function selectDossierRow(dossierID) {
            var gridDossier = $find("<%=rgDossiersAdmin.ClientID %>");
            var MasterTableDossier = gridDossier.get_masterTableView();
            var rows = MasterTableDossier.get_dataItems();

            for (var i = 0; i < rows.length; i++) {
                if (MasterTableDossier.getCellByColumnUniqueName(rows[i], "columnDossierID").innerHTML == dossierID) {
share|improve this question
up vote 3 down vote accepted

welcome to Code Review and thank you for your question. You need to profile the code to see for yourself where it is slow. Firebug and Chrome can do this. Only then will you be able to optimize your code.

Side note: Be careful about variable names, some of them seem to be in French (dossier).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.