Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
585
XamDataGrid, Trying to set a CellValuePresenter per cell in code behind
posted

Hello,

I am currently trying to set a single cell specific style in code behind. I have read/seen a bunch of examples of how to handle this with triggers. I specifically want to get this accomplished however in code behind. I attached a sample to demo on what I am trying to achieve. The XML document that I am using has 3 columns of information. The first column is the label. The 2nd and beyond columns are the data. I want to mark in red the cells that are different from column 2. The amount of data columns could be 2 or more. This example shows only 2. Please visit MarkDifferences() in the sample for clarity on what I want.

I am really curious/need guidance as to why

1. CellValuePresenter.FromCell() returns null for me?

2. Why Cell.Field.Settings.CellValuePresenterStyle seems to set the style for the entire column instead of just the cell.

If more info is needed I will provide.

Chad

 

 

ChangingCellLevelStyles.zip