I have sorting on my columns, and I'd like to adjust the style on the header name during the mouseover event (add an underline and change the mouse-pointer to a hand). I have seen posts do this but not limited to the header. I assume I need a style, I'm just not sure where/how to assign it. Thanks in advance for you time!
Patrick
Ok. I'll look into it. The id of the cell is the same for both headers (ctl00xContentPlaceHolder1xHoldings1xuwgHoldings_c_0_15). This is looking more challenging than I was expecting. I'll take a look. Thanks again!
Oh, I see... then maybe you can play with the second parameter of the event handlers (id of the cell?). The grid generates the IDs in such a way, that the grid ClientID is generated, then the row index and then the cell index, e.g.
UltraWebGrid1_0_0 would probably be the first header row
UltraWebGrid1_1_0 could be the second one
So maybe with regexp or string manipulations you can get to these 0,1 indices and run the logic in this case?
This works great for the first header row, but does not for the subsequent group headers. I have grouptotals for the grid. I checked the value of isHeader on one the headers below the first one, and it is set to 1. When I do hover over the group headers, the style on the first header changes.
Thanks for the info!! I will take a look and post back with results. Cheers.
Yes, this is possible - the technique revolves around using the client-side object model (CSOM) of the grid and the MouseOver and MouseOut events in particular. Here is some sample code:
<DisplayLayout Name="UltraWebGrid1"> <ClientSideEvents MouseOverHandler="mouseOver" MouseOutHandler="mouseOut" /> </DisplayLayout> <script type="text/javascript"> function mouseOver(gridID, cellID, isHeader) { if (isHeader) { var header = igtbl_getElementById(cellID); header.style.color = "red"; } } function mouseOut(gridID, cellID, isHeader) { if (isHeader) { var header = igtbl_getElementById(cellID); header.style.color = "black"; } } </script>
More info on UltraWebGrid's Client Side Events can be found here:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR3.5/html/WebGrid_Client_Side_Events_CSOM.html
Hope this helps.