Telerik Rad Grid is not able to access ClientID.

6 posts, 0 answers
  1. Devendra
    Devendra avatar
    3 posts
    Member since:
    May 2012

    Posted 10 May 2012 Link to this post

    Hi,

    I have telerik Rad Grid Control. I want disabled row to be checked even if someone check/uncheck select all functionality. So I have written below Jquery code to handle it.

    $(document).ready(function () {
            $("#SelectColumnSelectCheckBox").click(function () {
                var checked = this.checked;                      
                if (checked == false) {
                    $("#ctl00_MainContent_gridRules_ctl00 tbody tr").each(function () {
                        if ($(this).attr('disabled') == "disabled") {
                            $(this).find("input").attr('checked', 'checked');
                        }
                    });
                }
            });
        });

    I want to change the hardcoded value of grid (ctl00_MainContent_gridRules_ctl00) and Select all checkbox (SelectColumnSelectCheckBox) to clientID.

    I have tried <%=Radgrid.ClientID%> but that does not work.

    Does anyone know how to get the clientID of the telerik RAD grid?

    Please give me reply sooner as this is urgent for me.

    Thanks in advance.

    Regards,
    Devendra.
  2. RR SoftSol
    RR SoftSol avatar
    13 posts
    Member since:
    May 2012

    Posted 10 May 2012 Link to this post

    Hi there,

    From the telerik documentation i found this, and in practice it did work for me. Radgrid1 is the server side ID of your radgrid object.

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    var grid = $find("<%=RadGrid1.ClientID %>");
    //execute some logic here 
    </telerik:RadCodeBlock>

    Good luck, i hope this will work for you.
  3. Devendra
    Devendra avatar
    3 posts
    Member since:
    May 2012

    Posted 11 May 2012 Link to this post

    Hi,

    I also tried your solution but it is failing in var grid = $find("<%=RadGrid1.ClientID %>");. seems like $find is not a function in my jquery 1.6.2 version. so the above solution is not a good option.

    Regards,
    Devendra.
  4. RR SoftSol
    RR SoftSol avatar
    13 posts
    Member since:
    May 2012

    Posted 11 May 2012 Link to this post

    hey,

    $find is not from jquery, but comes with ajax. Though i am not sure from which library it comes from, i think it comes with the framework.
    One thing you could check just to be sure, is if you have a scriptmanager on your page?
    But i don't think radgrid would work at all without one.

    3.Add a ScriptManager control on top of the page in which you are going to add any RadControl.
    <asp:ScriptManager ID="ScriptManager1" runat="server" />

    Also, did you try to debug your application and let it break on the javascript line it fails? Then you can see in more detail what the problem is. You can even see if $find is declared or not. Or simply add an alert($find); before the line and then run the application could work as well i think.

    Good luck, perhaps you are on the right track now to find the problem :).
  5. Raksha
    Raksha avatar
    1 posts
    Member since:
    Nov 2016

    Posted 15 Nov 2016 Link to this post

    i see something here: http://www.techjunkieblog.com/2013/09/telerik-why-find-method-is-not-working.html
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4630 posts

    Posted 15 Nov 2016 Link to this post

    Hi all,

    The following article explains the details on getting client-side references and the events you should use: http://docs.telerik.com/devtools/aspnet-ajax/general-information/get-client-side-reference.

    Regards,

    Marin Bratanov
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top