Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

add a onmouseover handler to a row in a webgrid on the client side

Last post 09-22-2008 8:53 by StripeConsulting. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-08-2008 14:07

    • hawi1978
    • Top 500 Contributor
    • Joined on 07-02-2008
    • Points 268

    add a onmouseover handler to a row in a webgrid on the client side

    I'm trying to change the background color of a row in a webgrid onmouseover on the client side. Is there a way to do this.

    Thank you.

    • Post Points: 35
  • 07-09-2008 9:15 In reply to

    Re: add a onmouseover handler to a row in a webgrid on the client side

    Answer

    Hello,

    You can use the ClientSideEvents of UltraWebGrid and use events MouseOverHandler="Over" MouseOutHandler="Out" . With javascript function over and out you can manipulate background of rows:

    <ClientSideEvents MouseOverHandler="Over" MouseOutHandler="Out"/>

    ...

    <script type="text/javascript" language="javascript">   

        function Over(gridNane, cellID, objectType){       

            var cell = igtbl_getCellById(cellID);

            setRowBackColor(cell.Row, "red");        

        }

        function Out(gridNane, cellID, objectType){       

            var cell = igtbl_getCellById(cellID);

            setRowBackColor(cell.Row, "white");    

        }

        function setRowBackColor(row, color){

            var cells = row.getCellElements();       

            for (var i = 0; i < cells.length; i++) {

                cells[i].style.backgroundColor = color;       

            }  

        }

        </script>

    ...

     

     

     

    Best Regards,
    Ivan Baev
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 07-09-2008 12:49 In reply to

    • hawi1978
    • Top 500 Contributor
    • Joined on 07-02-2008
    • Points 268

    Re: add a onmouseover handler to a row in a webgrid on the client side

    That worked perfectly. Thank you!

    • Post Points: 20
  • 09-16-2008 15:30 In reply to

    Re: add a onmouseover handler to a row in a webgrid on the client side

    Is there a reason why this functionality was included on the WebCombo but left off of UltraWebGrid?
    • Post Points: 5
  • 09-22-2008 8:53 In reply to

    Re: add a onmouseover handler to a row in a webgrid on the client side

     Hi, just tried to implement this solution, (as a test to see what was going wrong),

    the original and now additional problem was trying to the show a Context Menu (as UltraWebMenu) on right click.

     

    I've suddenly also picked up a couple of hundred javascript errors, which makes me think its down to this:

    igmenu_showMenu(etc etc)

     

    I'm thinking, its not finding this command, possibly due to the convoluted series of frameworks I have installed on my development machine.

    (I have tried attaching several of the javascript files from 'C:\Inetpub\wwwroot\aspnet_client\Infragistics\20082CLR20\Scripts'  which appears to be where it should be looking... To no avail, yet it finds the images required for the controls ok)

    Is there an easy way to find out exactly what functions/images etc, are required for each control, and add them to my solution, and point the infragistics controls to this instead?

    --EDIT NOTE: I realized in reading other posts, that the fact that the grid, is in a user control, placed into a Content Page(w/ MasterPage), may have some bearing on the number of javascript errors, perhaps its down to the naming?

    Regards and thanks,

       Andrew Wilson
       Stripe Consulting

    • Post Points: 5
Page 1 of 1 (5 items)
Powered by Community Server (Commercial Edition), by Telligent Systems