Selecting all rows programmatic server or javascript during the PageLoad?

4 posts, 1 answers
  1. Bruno
    Bruno avatar
    26 posts
    Member since:
    Feb 2009

    Posted 02 Mar 2009 Link to this post

    Hello

    I Have one RadGrid where I want to update a status flag, everithing is working fine but I need that all rows starts selected to prevent the user to click on the "select all" checkbox.

    how can I do to programmatic or some Jscript to select all itens during pageload, or to select each item during databinding?


    I Imagine somethng like:

    RadGrid1.Checkboxes.attr("selected","true")
    or

    foreach (item in RadGrid1.Itens){
    this.selected = "true";
    }

    Thanxs
  2. Bruno
    Bruno avatar
    26 posts
    Member since:
    Feb 2009

    Posted 02 Mar 2009 Link to this post

    I tried that

    protected void Page_Load(object sender, EventArgs e) 
            { 
                foreach (int Item in RadGrid1.Items)  
                { 
                    RadGrid1.Items[Item].Selected = true
                }  
            } 

    But it isnt work in page_load...


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 02 Mar 2009 Link to this post

    Hello Bruno,

    Test the following snippet:
    protected void RadGrid1_PreRender(object sender, EventArgs e) 
        foreach (GridDataItem item in RadGrid1.Items) 
           item.Selected = true

    Regards,
    Daniel
    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.
  5. Bruno
    Bruno avatar
    26 posts
    Member since:
    Feb 2009

    Posted 02 Mar 2009 Link to this post

    Perfect!

    I Just include that

    OnPreRender="RadGrid1_PreRender" 

    Thank you!
Back to Top