Is there a way to modify the formatting of a grid cell to have a different style when it is clicked/selected?
I can render a cell with conditional formatting (borders) on Page_Load but am looking for something either client side, or in the server side control creation. Something like 'DisplayLayout.SelectedHeaderStyleDefault' but for a cell.
Is this possible?
I looked at the cell CSOM but couldn't see anything there that would help me.
Thanks in advance...
Thank you, very nearly perfect! I already had the Javascript in place, I just could work out how to get to the cell properties - so was missing the Element side of things.
I was looking to change the border thusly:
cell.Element.style.borderWidth = "2px";
But thank you, you put me very much in the right direction!
Hello,
You can use event CellClickHandler of ClientSideEvents and with JS code change color.
APSX:<ClientSideEvents CellClickHandler="CellClick" />
JS code: <script type="text/javascript"> var oldCell = null; function CellClick(a, cellID, c) { if (oldCell != null) { oldCell.Element.style.color = "Black"; } var newCell = igtbl_getCellById(cellID); oldCell = igtbl_getCellById(cellID); newCell.Element.style.color = "red"; }</script>
Hope this helps.