Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
115
to get ultrawebgrid row collection in client script
posted

hi ,

 i want to get ultrawebgrid row collection in client script................ i am trying to set background color of row on mouse over and on a row selected ...... 

but if one row is selected and if clicked on other row the background color of the previous row selected is also retained...................

 

Thanks in advance,

Sharath Vasu

Parents
No Data
Reply
  • 28464
    posted

    I think the following approach can be a good starting point for your case - in this setup I am highlighting / dehighlighting grid rows on mouseover.

    <igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server" DataSourceID="SqlDataSource1" Height="200px" Width="325px">
        <DisplayLayout>
            <ClientSideEvents MouseOverHandler="Over" MouseOutHandler="Out"/>
        </DisplayLayout>
    </igtbl:UltraWebGrid>


        <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>

    More info can be found here (in the CSOM (Client Side Object Model) section of the grid) - full javascript APIs for rows,cells, etc are available there.

    http://help.infragistics.com/NetAdvantage/NET/2008.2/CLR2.0/

Children