Hello
A quick question: given a xamGrid filled with textblocks of data, is it possible to hightlight certain cells based on given row index and cell index? Something like giving them another foreground or background? In some cases row index might point to a non-visible row, but that is another discussion and I'm only concerned about actually re-rendering the specific cells.
Thanks
Sorry, my bad. I was setting foreground color only in the style and empty cells looked like nothing was happening. It's all good :)
Thanks, but that does not solve what I want to achieve. Your suggestion seems to work nicely for an active cell, however in my case there are no active cells, the silverlight app is not even in focus and I have index values for row and cell that I want to highlight. I pass these from JavaScript to the silverlight app and the code is executing in the Silverlight app as expected, but I am not able to make visual changes to the cell.
Here is a method I've created in Silverlight:
[ScriptableMember] public void HighlightCell(string index) { int rowIdx = Convert.ToInt32(index.Split(',')[0]); int cellIdx = Convert.ToInt32(index.Split(',')[1]); Answers.Rows[rowIdx].Cells[cellIdx].Style = Resources["invalidContentStyle"] as Style; }
this method receives a string value in the format like "2,1" telling it that row with index = 2 and cell with index = 1 within that row should be highlighted.
Hi,
You can set the Style property of the cell that you want to highlight if you want to highlight cells in different columns (like in the attached sample) or the conditional formatting feature of the XamGrid if you want to highlight cells in sa single column based on a predefined rule.
HTH,