HI,
I am searching a row in ultrawebgrid and highlighting with "yellow" color.
I am highlighting the row from code behind.
e.g
rows.Style.BackColor = System.Drawing.Color.FromArgb(255, 255, 185)
Now my requirement is that after clicking outside row color should be change.I am doing this throuugh javacript.
row.Element.className = "deactiveColor"
"deactiveColor" is my classname.
I tried
activeRow.Element.style.backgroundColor = "Red";
and
activeRow.Element.bgColor = 'red';
but this is not working.
Hello juliep,
Thank you for posting in the community.
A possible straightforward approach may be to change the selected row style of your grid if your application allows that (i.e. if single selection is enabled).
In order to change the backcolor of an activated row through javascript, the CSS has to be applied on the respective row's cells, and the previously activated row's color should be reverted. This may be achieved by handling the AfterRowActivate clientside event. For instance (using a bit of jQuery):
Please let me know if this helps.
Hi,
Thanks for reply but this is not what I want.
after clicking outside grid view means anywhere on page then the color should be change.
Please feel free to contact me if you are still experiencing any issues with this matter.
Hi juliep,
If you wish to remove the styling and deactivate a row when clicking outside the grid, a possible apporach may be to handle the onclick event of the page's body. An example handler may look like:
function removeRowHighlight() { if (oldActivatedRow.oldRow != null) { //deactivate row and remove styling igtbl_getGridById("UltraWebGrid1").setActiveRow(); $(oldActivatedRow.oldRow.getCellElements()).css("background-color", "White"); }}
function removeRowHighlight() {
if (oldActivatedRow.oldRow != null) { //deactivate row and remove styling igtbl_getGridById("UltraWebGrid1").setActiveRow(); $(oldActivatedRow.oldRow.getCellElements()).css("background-color", "White"); }}
Please note that the UltraWebGrid control is now outdated and as of .NetAdvantage 2011 Volume 2 is no longer included in our product package. I would suggest that you consider switching to the WebDataGrid/WebHieararchicalDataGrid. More information regarding these controls is available at:
http://help.infragistics.com/NetAdvantage/ASPNET/2011.2/CLR4.0/?page=Web_WebDataGrid_WebDataGrid.html
Additional samples demonstrating the features of these grids can be found at:http://samples.infragistics.com/aspnet/
Feel free to contact me if you need more information.