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
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/
Please give me some tips on how can i get row collection of ultrawebgrid ........ because that will solve my problem.
Thanks,
You can get the selected rows colletion through this:
var grid = igtbl_getGridById(gridId);
{
var row = igtbl_getRowById(rowId);
//Your logic with the row object
}