AllowRowSelect="True"

5 posts, 0 answers
  1. mro
    mro avatar
    15 posts
    Member since:
    Jun 2007

    Posted 01 May 2008 Link to this post

    Hi,
    This is my third post since using new Prometheus controls (and that is only 2 weeks and only grid control). The first 2 problems are not yet solved and here is the new one.
    I have a grid with check boxes and i do not want a user to be able to select a row if a check box is disabled, and i do not want a user to select a row by clicking on it and if the header check box is clicked i do not want the rows with disabled check boxes to be selected. It all worked in the previous rad grid like this:

     <script type="text/javascript">    
                var currentClickEvent = null;   
       
                function GridCreated()   
                {   
                    var grid = this;   
                       
                    //non-ie click event capture   
                    //the event handler will get fired *before* the row click event    
                    //and we use that to cache the current event object   
                    if (grid.Control.addEventListener)   
                        grid.Control.addEventListener("click", GridTableClick, true);   
                }   
       
                function GridTableClick(e)   
                {   
                    currentClickEvent = e;   
                }   
                   
                //IE has a global event object. We get the previously cached event object for other browsers   
                function GetClickEvent()   
                {   
                    return window.event || currentClickEvent;   
                }   
                   
                //cancel all select/deselect operation triggered by non-checkbox row clicks   
                function CancelNonInputSelect(row)    
                {    
                    var e = GetClickEvent();   
                    //IE - srcElement, Others - target   
                    var targetElement = e.srcElement || e.target;   
       
                    //is the clicked element a checkbox? <input type="checkbox"...>   
                    if(targetElement.tagName.toLowerCase() != "input" &&   
                        targetElement.type.toLowerCase() != "checkbox")   
                    {   
                        //cancel the event   
                        return false;   
                    }   
                       
                    //clean up after all (de)selections are performed   
                    window.setTimeout(function() {   
                        currentClickEvent = null;   
                       }, 0);   
                }    
              </script>   


    and this is from the grid:

     
       <ClientSettings> 
       <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" ></Selecting
    <ClientEvents OnGridCreated="GridCreated" OnRowSelecting="CancelNonInputSelect" OnRowDeselecting="CancelNonInputSelect" /> 
    </ClientSettings> 


    Now nothing works. I think i will go back to previous version.
  2. mro
    mro avatar
    15 posts
    Member since:
    Jun 2007

    Posted 01 May 2008 Link to this post

    I forgot the question:
    Can new Telerik Grid Q1 ASP.NET Ajax do this:
    1. If check box is disabled prevent row selection.
    2. When clicking on the select all do not select rows with disabled check boxes and check the "select all".
    3. When unselecting "select all" unselect all.

    If i have to search trough the forums all day what's the point then of using this? Microsoft grid view can do this if you spend all day on google.

    Thank you,
    Mario


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 05 May 2008 Link to this post

    Mario, I found these examples which might put you in the right direction:

    http://www.telerik.com/community/code-library/submission/b311D-mkmkk.aspx
    http://www.telerik.com/community/code-library/submission/b311D-hgmtb.aspx

    Probably a combination/modification of these samples will give you the functionality you are searching for.

    Kiara
  5. mro
    mro avatar
    15 posts
    Member since:
    Jun 2007

    Posted 07 May 2008 Link to this post

    Thank you Kiara but that did not help. As I said, I have a solutions which works fine with the old grid.
  6. Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 07 May 2008 Link to this post

    Oh, I missed that part, sorry. However, porting an old exisiting javascript code to the new RadGrid for ASP.NET AJAX may require some modifications. Use this help topic for further pointers.

    Kiara
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017